Documentation
¶
Index ¶
Constants ¶
View Source
const OperationEnvelopeVersion = "anixops.operation/v1"
View Source
const (
ProtocolVersion = "anix.agent.v1"
)
Variables ¶
View Source
var ErrNotPluginEnvelope = errors.New("desired operation is not an AnixOps plugin envelope")
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) IsConnected ¶
type Config ¶
type Config struct {
Target string
NodeID int
APIKey string
UseTLS bool
ServerName string
AgentVersion string
InstanceID string
Capabilities []*agentv1pb.Capability
Labels map[string]string
KeepaliveTime time.Duration
Heartbeat time.Duration
ReconnectMin time.Duration
ReconnectMax time.Duration
DialTimeout time.Duration
HandshakeTimeout time.Duration
Handler OperationHandler
DialContext DialContextFunc
DialOptions []grpc.DialOption
Rand *mathrand.Rand
}
type DialContextFunc ¶
type DialContextFunc func(context.Context, string, ...grpc.DialOption) (*grpc.ClientConn, error)
type OperationEnvelope ¶
type OperationEnvelope struct {
Version string `json:"version"`
OperationID string `json:"operation_id"`
IdempotencyKey string `json:"idempotency_key"`
SessionID string `json:"session_id"`
Revision uint64 `json:"revision"`
PluginID string `json:"plugin_id"`
TargetVersion string `json:"target_version"`
ConfigHash string `json:"config_hash"`
Config json.RawMessage `json:"config"`
}
OperationEnvelope travels in DesiredOperation.payload_json. Keeping the outer protobuf stable lets older Agents retain their compatibility commands while plugin-aware Agents can require the full persistent-operation contract.
func DecodeOperationEnvelope ¶
func DecodeOperationEnvelope(operation *agentv1pb.DesiredOperation) (*OperationEnvelope, error)
func DecodeOperationEnvelopeContext ¶
func DecodeOperationEnvelopeContext(ctx context.Context, operation *agentv1pb.DesiredOperation) (*OperationEnvelope, error)
DecodeOperationEnvelopeContext additionally binds a plugin operation to the active Agent Control stream. DecodeOperationEnvelope remains available for offline validation and legacy callers that do not own a live session.
func (OperationEnvelope) Validate ¶
func (e OperationEnvelope) Validate(operation *agentv1pb.DesiredOperation) error
type OperationHandler ¶
type OperationHandler interface {
HandleOperation(context.Context, *agentv1pb.DesiredOperation) (json.RawMessage, error)
}
type OperationHandlerFunc ¶
type OperationHandlerFunc func(context.Context, *agentv1pb.DesiredOperation) (json.RawMessage, error)
func (OperationHandlerFunc) HandleOperation ¶
func (f OperationHandlerFunc) HandleOperation(ctx context.Context, operation *agentv1pb.DesiredOperation) (json.RawMessage, error)
Click to show internal directories.
Click to hide internal directories.