Documentation ¶
Index ¶
- Constants
- func StateAsString(s *agentsv1.Answer) string
- func ToMethod(req any) agentsv1.Method
- type Client
- type ClientContext
- func (c *ClientContext) Confirm(s int) *agentsv1.ConfirmAnswer
- func (c *ClientContext) Display(msg *agentsv1.Message, data map[string]string) *agentsv1.Question
- func (c *ClientContext) Get() string
- func (c *ClientContext) Input(i int) *agentsv1.InputAnswer
- func (c *ClientContext) NewChoice(msg *agentsv1.Message, options ...*agentsv1.Message) *agentsv1.Question
- func (c *ClientContext) NewConfirm(msg *agentsv1.Message, defaultConfirm bool) *agentsv1.Question
- func (c *ClientContext) NewSelection(msg *agentsv1.Message, options ...*agentsv1.Message) *agentsv1.Question
- func (c *ClientContext) NewSequence(qs ...*agentsv1.Question) (*Sequence, error)
- func (c *ClientContext) NewStringInput(msg *agentsv1.Message, defaultValue string) *agentsv1.Question
- func (c *ClientContext) NextRound() int32
- func (c *ClientContext) Process(eng *agentsv1.Engage) (*agentsv1.InformationRequest, error)
- func (c *ClientContext) Ready() bool
- func (c *ClientContext) SafeConfirm(s int) (*agentsv1.ConfirmAnswer, error)
- func (c *ClientContext) Selection(i int) *agentsv1.SelectionAnswer
- type ClientManager
- type NoOpClientContext
- type QuestionHandler
- type Sequence
- type ServerContext
- type ServerManager
Constants ¶
View Source
const (
Create = agentsv1.Method_CREATE
)
View Source
const (
Sync = agentsv1.Method_SYNC
)
Variables ¶
This section is empty.
Functions ¶
func StateAsString ¶
Types ¶
type ClientContext ¶
type ClientContext struct { Method agentsv1.Method Client Client // contains filtered or unexported fields }
func NewClientContext ¶
func (*ClientContext) Confirm ¶
func (c *ClientContext) Confirm(s int) *agentsv1.ConfirmAnswer
func (*ClientContext) Get ¶
func (c *ClientContext) Get() string
func (*ClientContext) Input ¶
func (c *ClientContext) Input(i int) *agentsv1.InputAnswer
func (*ClientContext) NewConfirm ¶
func (*ClientContext) NewSelection ¶
func (*ClientContext) NewSequence ¶
func (c *ClientContext) NewSequence(qs ...*agentsv1.Question) (*Sequence, error)
NewSequence creates a SequenceClient
func (*ClientContext) NewStringInput ¶
func (*ClientContext) NextRound ¶
func (c *ClientContext) NextRound() int32
func (*ClientContext) Process ¶
func (c *ClientContext) Process(eng *agentsv1.Engage) (*agentsv1.InformationRequest, error)
func (*ClientContext) Ready ¶
func (c *ClientContext) Ready() bool
func (*ClientContext) SafeConfirm ¶
func (c *ClientContext) SafeConfirm(s int) (*agentsv1.ConfirmAnswer, error)
func (*ClientContext) Selection ¶
func (c *ClientContext) Selection(i int) *agentsv1.SelectionAnswer
type ClientManager ¶
type ClientManager struct {
// contains filtered or unexported fields
}
func NewClientManager ¶
func NewClientManager() *ClientManager
func (*ClientManager) Add ¶
func (m *ClientManager) Add(method agentsv1.Method, client *ClientContext) error
func (*ClientManager) Process ¶
func (m *ClientManager) Process(eng *agentsv1.Engage) (*agentsv1.InformationRequest, error)
func (*ClientManager) WithLogger ¶
func (m *ClientManager) WithLogger(logger shared.BaseLogger)
type NoOpClientContext ¶
type NoOpClientContext struct{}
func NewNoOpClientContext ¶
func NewNoOpClientContext() *NoOpClientContext
func (*NoOpClientContext) Process ¶
func (c *NoOpClientContext) Process(req *agentsv1.Engage) (*agentsv1.InformationRequest, error)
func (*NoOpClientContext) Ready ¶
func (c *NoOpClientContext) Ready() bool
type QuestionHandler ¶
type QuestionHandler interface {
Process(req *agentsv1.InformationRequest) (*agentsv1.Answer, error)
}
type ServerContext ¶
type ServerContext struct { Handler QuestionHandler Method agentsv1.Method // contains filtered or unexported fields }
func NewServerContext ¶
func NewServerContext(method agentsv1.Method, logger shared.BaseLogger) *ServerContext
func (*ServerContext) Communicate ¶
func (*ServerContext) Done ¶
func (c *ServerContext) Done() bool
func (*ServerContext) Process ¶
func (c *ServerContext) Process(request *agentsv1.InformationRequest) (*agentsv1.Answer, error)
type ServerManager ¶
type ServerManager struct {
// contains filtered or unexported fields
}
func NewServerManager ¶
func NewServerManager(logger shared.BaseLogger) *ServerManager
func (*ServerManager) Register ¶
func (m *ServerManager) Register(channels ...*agentsv1.Channel) error
func (*ServerManager) RequiresCommunication ¶
func (m *ServerManager) RequiresCommunication(req any) (*ServerContext, bool)
Click to show internal directories.
Click to hide internal directories.