-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.go
55 lines (41 loc) · 1.38 KB
/
types.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
package codegen
import (
"github.com/streamingfast/substreams-codegen/loop"
pbconvo "github.com/streamingfast/substreams-codegen/pb/sf/codegen/conversation/v1"
)
type AskProjectName struct{}
type InputProjectName struct{ pbconvo.UserInput_TextInput }
type AskChainName struct{}
type MsgInvalidChainName struct{}
type InputChainName struct{ pbconvo.UserInput_Selection }
type InputSourceDownloaded struct{ pbconvo.UserInput_Confirmation }
type PackageDownloaded struct{ pbconvo.UserInput_Confirmation }
type AskConfirmCompile struct{}
type InputConfirmCompile struct{ pbconvo.UserInput_Confirmation } // SQL specific
type AskInitialStartBlockType struct{}
type InputAskInitialStartBlockType struct{ pbconvo.UserInput_TextInput }
func InputAskInitialStartBlockTypeTextInput() string {
return "At what block do you want to start indexing data?"
}
func InputAskInitialStartBlockTypeRegex() string {
return `^\d+$`
}
func InputAskInitialStartBlockTypeValidation() string {
return "The start block cannot be empty and must be a number"
}
type RunGenerate struct{}
type ReturnGenerate struct {
Err error
ProjectFiles map[string][]byte
}
func (c ReturnGenerate) Error(msg *MsgWrap) loop.Cmd {
return loop.Seq(
msg.Messagef("Code generation failed with error: %s", c.Err).Cmd(),
loop.Quit(c.Err),
)
}
type MsgGenerateProgress struct {
Progress int
Logs []string
Continue bool
}