Documentation
¶
Index ¶
- Variables
- func ClearCurrent()
- func SetCurrent(client *Client)
- type Client
- func (c *Client) Close()
- func (c *Client) Enabled() bool
- func (c *Client) GetConfig(ctx context.Context) ([]byte, error)
- func (c *Client) GetModels(ctx context.Context) ([]byte, error)
- func (c *Client) GetRefreshAuth(ctx context.Context, authIndex string) ([]byte, error)
- func (c *Client) HeartbeatOK() bool
- func (c *Client) LPushUsage(ctx context.Context, payload []byte) error
- func (c *Client) Ping(ctx context.Context) error
- func (c *Client) RPopAuth(ctx context.Context, requestedModel string, sessionID string, ...) ([]byte, error)
- func (c *Client) RPushRequestLog(ctx context.Context, payload []byte) error
- func (c *Client) StartConfigSubscriber(ctx context.Context, onConfig func([]byte) error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrDisabled = errors.New("home client disabled") ErrNotConnected = errors.New("home not connected") ErrEmptyResponse = errors.New("home returned empty response") ErrAuthNotFound = errors.New("home auth not found") ErrConfigNotFound = errors.New("home config not found") ErrModelsNotFound = errors.New("home models not found") )
Functions ¶
func SetCurrent ¶
func SetCurrent(client *Client)
SetCurrent sets the active home client used by runtime integrations.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func New ¶
func New(homeCfg config.HomeConfig) *Client
func (*Client) GetRefreshAuth ¶
func (*Client) HeartbeatOK ¶
func (*Client) RPushRequestLog ¶
func (*Client) StartConfigSubscriber ¶
StartConfigSubscriber connects to home, fetches config once via GET config, then subscribes to the "config" channel to receive runtime config updates.
The subscription connection is treated as the home heartbeat. HeartbeatOK is set to true only after the initial GET config succeeds and the SUBSCRIBE connection is established. When the subscription ends unexpectedly, HeartbeatOK becomes false and the loop reconnects.
Click to show internal directories.
Click to hide internal directories.