Documentation
¶
Index ¶
- Variables
- type DynamicBuilder
- type GRPCClient
- func (c *GRPCClient) Close(ctx context.Context) error
- func (c *GRPCClient) Invoke(ctx context.Context, fqrn string, req, res interface{}) error
- func (c GRPCClient) ListServices() ([]entity.Service, error)
- func (c *GRPCClient) NewBidiStream(ctx context.Context, rpc entity.RPC) (entity.BidiStream, error)
- func (c *GRPCClient) NewClientStream(ctx context.Context, rpc entity.RPC) (entity.ClientStream, error)
- func (c *GRPCClient) NewServerStream(ctx context.Context, rpc entity.RPC) (entity.ServerStream, error)
- func (c GRPCClient) ReflectionEnabled() bool
- type JSONFileInputter
- type Prompt
- type Prompter
- type RealPrompter
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrUnknownOneofFieldName = errors.New("unknown oneof field name") ErrUnknownEnumName = errors.New("unknown enum name") EORF = errors.New("end of repeated field") )
View Source
var NewRealPrompter = func(executor func(string), completer func(prompt.Document) []prompt.Suggest, opt ...prompt.Option) Prompter { if executor == nil { executor = func(in string) { return } } if completer == nil { completer = func(d prompt.Document) []prompt.Suggest { return nil } } p := &RealPrompter{} p.fieldPrompter = prompt.New( executor, completer, append(opt, prompt.OptionLivePrefix(p.livePrefix), prompt.OptionAddKeyBind(prompt.KeyBind{ Key: prompt.Enter, Fn: func(_ *prompt.Buffer) { p.entered = true }, }), )...) return p }
NewRealPrompter instantiates a prompt which satisfied Prompter with go-prompt. NewRealPrompter will be replace by a mock when e2e testing.
NewRealPrompter is called to create REPL-CLI and REPL field inputter. NewPrompt is the short-hand method to create *Prompt with no params NewRealPrompter.
Functions ¶
This section is empty.
Types ¶
type DynamicBuilder ¶
type DynamicBuilder struct{}
func NewDynamicBuilder ¶
func NewDynamicBuilder() *DynamicBuilder
func (*DynamicBuilder) NewMessage ¶
func (b *DynamicBuilder) NewMessage(m entity.Message) proto.Message
type GRPCClient ¶
type GRPCClient struct {
// contains filtered or unexported fields
}
func NewGRPCClient ¶
func NewGRPCClient(config *config.Config) (*GRPCClient, error)
func (*GRPCClient) Invoke ¶
func (c *GRPCClient) Invoke(ctx context.Context, fqrn string, req, res interface{}) error
func (GRPCClient) ListServices ¶
func (*GRPCClient) NewBidiStream ¶
func (c *GRPCClient) NewBidiStream(ctx context.Context, rpc entity.RPC) (entity.BidiStream, error)
func (*GRPCClient) NewClientStream ¶
func (c *GRPCClient) NewClientStream(ctx context.Context, rpc entity.RPC) (entity.ClientStream, error)
func (*GRPCClient) NewServerStream ¶
func (c *GRPCClient) NewServerStream(ctx context.Context, rpc entity.RPC) (entity.ServerStream, error)
func (GRPCClient) ReflectionEnabled ¶
func (c GRPCClient) ReflectionEnabled() bool
type JSONFileInputter ¶
type JSONFileInputter struct {
// contains filtered or unexported fields
}
func NewJSONFileInputter ¶
func NewJSONFileInputter(in io.Reader) *JSONFileInputter
type Prompt ¶
type Prompt struct {
// contains filtered or unexported fields
}
Prompt is an implementation of inputting method. it has common logic to input fields interactively. in normal, go-prompt is used as prompt.
type Prompter ¶
type Prompter interface { // Run is called from REPL input prompter Run() Input() (string, error) Select(msg string, opts []string) (string, error) SetPrefix(prefix string) SetPrefixColor(color color.Color) error }
Prompter represents prompter which display inputters or selectors.
type RealPrompter ¶
type RealPrompter struct {
// contains filtered or unexported fields
}
func (*RealPrompter) Input ¶
func (p *RealPrompter) Input() (string, error)
func (*RealPrompter) Run ¶
func (p *RealPrompter) Run()
func (*RealPrompter) Select ¶
func (p *RealPrompter) Select(msg string, opts []string) (string, error)
func (*RealPrompter) SetPrefix ¶
func (p *RealPrompter) SetPrefix(prefix string)
func (*RealPrompter) SetPrefixColor ¶
func (p *RealPrompter) SetPrefixColor(color color.Color) error
Click to show internal directories.
Click to hide internal directories.