Documentation
¶
Index ¶
- Constants
- func Ptr[T any](v T) *T
- type AuthConfig
- type Client
- func (c *Client) Agent() v1connect.AgentServiceClient
- func (c *Client) Auth() v1connect.AuthServiceClient
- func (c *Client) Event() v1connect.EventServiceClient
- func (c *Client) Message() v1connect.MessageServiceClient
- func (c *Client) Model() v1connect.ModelServiceClient
- func (c *Client) ModelProvider() v1connect.ModelProviderServiceClient
- func (c *Client) Skill() v1connect.SkillServiceClient
- func (c *Client) Task() v1connect.TaskServiceClient
- type ClientOption
- type ClientOptions
- type EndpointContext
- type EndpointContexts
- type MockClient
Constants ¶
View Source
const ( AuthTypeToken = "token" KeyringRefPrefix = "keyring://construct/" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AuthConfig ¶
type AuthConfig struct {
Type string `yaml:"type,omitempty"`
Token string `yaml:"token,omitempty"`
TokenRef string `yaml:"token-ref,omitempty"`
}
func (*AuthConfig) IsConfigured ¶
func (a *AuthConfig) IsConfigured() bool
func (*AuthConfig) KeyringKey ¶
func (a *AuthConfig) KeyringKey() string
func (*AuthConfig) Validate ¶
func (a *AuthConfig) Validate() error
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(endpointContext EndpointContext, options ...ClientOption) (*Client, error)
func (*Client) Agent ¶
func (c *Client) Agent() v1connect.AgentServiceClient
func (*Client) Auth ¶
func (c *Client) Auth() v1connect.AuthServiceClient
func (*Client) Event ¶
func (c *Client) Event() v1connect.EventServiceClient
func (*Client) Message ¶
func (c *Client) Message() v1connect.MessageServiceClient
func (*Client) Model ¶
func (c *Client) Model() v1connect.ModelServiceClient
func (*Client) ModelProvider ¶
func (c *Client) ModelProvider() v1connect.ModelProviderServiceClient
func (*Client) Skill ¶
func (c *Client) Skill() v1connect.SkillServiceClient
func (*Client) Task ¶
func (c *Client) Task() v1connect.TaskServiceClient
type ClientOption ¶
type ClientOption func(*ClientOptions)
func WithAuthToken ¶
func WithAuthToken(token string) ClientOption
func WithConnectOptions ¶
func WithConnectOptions(options ...connect.ClientOption) ClientOption
func WithHTTPClient ¶
func WithHTTPClient(client *http.Client) ClientOption
type ClientOptions ¶
type ClientOptions struct {
HTTPClient *http.Client
ConnectOptions []connect.ClientOption
}
type EndpointContext ¶
type EndpointContext struct {
Address string `yaml:"address"`
Kind string `yaml:"kind"`
Auth *AuthConfig `yaml:"auth,omitempty"`
}
func (*EndpointContext) Validate ¶
func (c *EndpointContext) Validate() error
type EndpointContexts ¶
type EndpointContexts struct {
CurrentContext string `yaml:"current"`
PreviousContext string `yaml:"previous"`
Contexts map[string]EndpointContext `yaml:"contexts"`
}
func (*EndpointContexts) Current ¶
func (c *EndpointContexts) Current() (EndpointContext, bool)
func (*EndpointContexts) SetCurrent ¶
func (c *EndpointContexts) SetCurrent(contextName string) error
func (*EndpointContexts) SetPrevious ¶
func (c *EndpointContexts) SetPrevious(contextName string) error
func (*EndpointContexts) Validate ¶
func (c *EndpointContexts) Validate() error
type MockClient ¶
type MockClient struct {
ModelProvider *mocks.MockModelProviderServiceClient
Model *mocks.MockModelServiceClient
Agent *mocks.MockAgentServiceClient
Task *mocks.MockTaskServiceClient
Message *mocks.MockMessageServiceClient
Auth *mocks.MockAuthServiceClient
Skill *mocks.MockSkillServiceClient
Event *mocks.MockEventServiceClient
}
func NewMockClient ¶
func NewMockClient(ctrl *gomock.Controller) *MockClient
func (*MockClient) Client ¶
func (c *MockClient) Client() *Client
Click to show internal directories.
Click to hide internal directories.