Documentation
¶
Index ¶
- func NamespaceToProto(namespace *types.Namespace) *generated.Namespace
- func ProtoToNamespace(proto *generated.Namespace) (*types.Namespace, error)
- func ProtoToService(proto *generated.Service) (*types.Service, error)
- func ServiceToProto(service *types.Service) *generated.Service
- type Client
- type ClientOptions
- type ConfigmapClient
- func (c *ConfigmapClient) CreateConfigmap(configmap *types.Configmap, ensureNamespace bool) error
- func (c *ConfigmapClient) DeleteConfigmap(namespace, name string) error
- func (c *ConfigmapClient) GetConfigmap(namespace, name string) (*types.Configmap, error)
- func (c *ConfigmapClient) GetLogger() log.Logger
- func (c *ConfigmapClient) ListConfigmaps(namespace string, labelSelector string, fieldSelector string) ([]*types.Configmap, error)
- func (c *ConfigmapClient) UpdateConfigmap(configmap *types.Configmap) error
- type ExecClient
- type ExecOptions
- type ExecSession
- func (s *ExecSession) Close() error
- func (s *ExecSession) InitializeInstanceTarget(target string, namespace string, options *ExecOptions) error
- func (s *ExecSession) InitializeServiceTarget(target string, namespace string, options *ExecOptions) error
- func (s *ExecSession) RunInteractive() error
- func (s *ExecSession) RunNonInteractive() error
- type HealthClient
- type InstanceClient
- func (i *InstanceClient) GetInstance(namespace, id string) (*types.Instance, error)
- func (i *InstanceClient) ListInstances(namespace, serviceID, labelSelector, fieldSelector string) ([]*types.Instance, error)
- func (i *InstanceClient) RestartInstance(namespace, id string, timeout time.Duration) error
- func (i *InstanceClient) StartInstance(namespace, id string) error
- func (i *InstanceClient) StopInstance(namespace, id string, timeout time.Duration) error
- func (i *InstanceClient) WatchInstances(namespace, serviceID, labelSelector, fieldSelector string) (<-chan InstanceWatchEvent, error)
- type InstanceWatchEvent
- type LogClient
- type NamespaceClient
- func (n *NamespaceClient) CreateNamespace(namespace *types.Namespace) error
- func (n *NamespaceClient) DeleteNamespace(name string, ignoreNotFound, force bool) error
- func (n *NamespaceClient) GetLogger() log.Logger
- func (n *NamespaceClient) GetNamespace(name string) (*types.Namespace, error)
- func (n *NamespaceClient) ListNamespaces(labelSelector, fieldSelector map[string]string) ([]*types.Namespace, error)
- func (n *NamespaceClient) WatchNamespaces(labelSelector, fieldSelector map[string]string) (<-chan *types.Namespace, error)
- type SecretClient
- func (s *SecretClient) CreateSecret(secret *types.Secret, ensureNamespace bool) error
- func (s *SecretClient) DeleteSecret(namespace, name string) error
- func (s *SecretClient) GetLogger() log.Logger
- func (s *SecretClient) GetSecret(namespace, name string) (*types.Secret, error)
- func (s *SecretClient) ListSecrets(namespace string, labelSelector string, fieldSelector string) ([]*types.Secret, error)
- func (s *SecretClient) UpdateSecret(secret *types.Secret, force bool) error
- type ServiceClient
- func (s *ServiceClient) CreateService(service *types.Service, ensureNamespace bool) error
- func (s *ServiceClient) DeleteService(namespace, name string) error
- func (s *ServiceClient) DeleteServiceWithRequest(req *generated.DeleteServiceRequest) (*generated.DeleteServiceResponse, error)
- func (s *ServiceClient) GetDeletionStatus(namespace, name string) (*generated.GetDeletionStatusResponse, error)
- func (s *ServiceClient) GetLogger() log.Logger
- func (s *ServiceClient) GetService(namespace, name string) (*types.Service, error)
- func (s *ServiceClient) ListDeletionOperations(namespace, status string) (*generated.ListDeletionOperationsResponse, error)
- func (s *ServiceClient) ListInstances(req *generated.ListInstancesRequest) (*generated.ListInstancesResponse, error)
- func (s *ServiceClient) ListServices(namespace string, labelSelector string, fieldSelector string) ([]*types.Service, error)
- func (s *ServiceClient) ScaleService(namespace, name string, scale int) error
- func (s *ServiceClient) ScaleServiceWithRequest(req *generated.ScaleServiceRequest) (*generated.ServiceResponse, error)
- func (s *ServiceClient) UpdateService(service *types.Service, force bool) error
- func (s *ServiceClient) WatchScaling(namespace, name string, targetScale int) (<-chan *generated.ScalingStatusResponse, context.CancelFunc, error)
- func (s *ServiceClient) WatchServices(namespace string, labelSelector string, fieldSelector string) (<-chan WatchEvent, context.CancelFunc, error)
- type WatchEvent
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NamespaceToProto ¶
NamespaceToProto converts a domain namespace to a protobuf message.
func ProtoToNamespace ¶
ProtoToNamespace converts a protobuf message to a domain namespace.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client provides a client for interacting with the Rune API server.
func NewClient ¶
func NewClient(options *ClientOptions) (*Client, error)
NewClient creates a new API client with the given options.
func (*Client) Conn ¶
func (c *Client) Conn() *grpc.ClientConn
Conn exposes the underlying gRPC connection for generated clients
type ClientOptions ¶
type ClientOptions struct {
// Address of the API server
Address string
// TLS configuration
UseTLS bool
TLSCertFile string
// Authentication (token-only)
Token string
// Timeouts
DialTimeout time.Duration
CallTimeout time.Duration
// Logger
Logger log.Logger
}
ClientOptions holds configuration options for the API client.
func DefaultClientOptions ¶
func DefaultClientOptions() *ClientOptions
DefaultClientOptions returns the default client options.
type ConfigmapClient ¶
type ConfigmapClient struct {
// contains filtered or unexported fields
}
ConfigmapClient provides methods for interacting with configs on the Rune API server.
func NewConfigmapClient ¶
func NewConfigmapClient(client *Client) *ConfigmapClient
NewConfigmapClient creates a new configmap client.
func (*ConfigmapClient) CreateConfigmap ¶
func (c *ConfigmapClient) CreateConfigmap(configmap *types.Configmap, ensureNamespace bool) error
CreateConfig creates a new configmap on the API server.
func (*ConfigmapClient) DeleteConfigmap ¶
func (c *ConfigmapClient) DeleteConfigmap(namespace, name string) error
DeleteConfigmap deletes a configmap.
func (*ConfigmapClient) GetConfigmap ¶
func (c *ConfigmapClient) GetConfigmap(namespace, name string) (*types.Configmap, error)
GetConfigmap retrieves a configmap by name.
func (*ConfigmapClient) GetLogger ¶
func (c *ConfigmapClient) GetLogger() log.Logger
GetLogger returns the logger for this client
func (*ConfigmapClient) ListConfigmaps ¶
func (c *ConfigmapClient) ListConfigmaps(namespace string, labelSelector string, fieldSelector string) ([]*types.Configmap, error)
ListConfigmaps lists configmaps in a namespace.
func (*ConfigmapClient) UpdateConfigmap ¶
func (c *ConfigmapClient) UpdateConfigmap(configmap *types.Configmap) error
UpdateConfigmap updates an existing configmap.
type ExecClient ¶
type ExecClient struct {
// contains filtered or unexported fields
}
ExecClient provides methods for executing commands in instances.
func NewExecClient ¶
func NewExecClient(client *Client) *ExecClient
NewExecClient creates a new exec client.
func (*ExecClient) NewExecSession ¶
func (e *ExecClient) NewExecSession(ctx context.Context) (*ExecSession, error)
NewExecSession creates a new exec session.
type ExecOptions ¶
type ExecOptions struct {
Command []string // Command and arguments to execute
Env map[string]string // Environment variables to set
WorkingDir string // Working directory for the command
TTY bool // Whether to allocate a pseudo-TTY
TerminalWidth uint32 // Initial terminal width
TerminalHeight uint32 // Initial terminal height
Timeout time.Duration // Timeout for the exec session
}
ExecOptions defines the configuration for command execution.
type ExecSession ¶
type ExecSession struct {
// contains filtered or unexported fields
}
ExecSession represents an active exec session.
func (*ExecSession) InitializeInstanceTarget ¶
func (s *ExecSession) InitializeInstanceTarget(target string, namespace string, options *ExecOptions) error
InitializeInstanceTarget initializes the exec session with the given options.
func (*ExecSession) InitializeServiceTarget ¶
func (s *ExecSession) InitializeServiceTarget(target string, namespace string, options *ExecOptions) error
InitializeServiceTarget initializes the exec session with the given options.
func (*ExecSession) RunInteractive ¶
func (s *ExecSession) RunInteractive() error
RunInteractive runs an interactive exec session.
func (*ExecSession) RunNonInteractive ¶
func (s *ExecSession) RunNonInteractive() error
RunNonInteractive runs a non-interactive exec session.
type HealthClient ¶
type HealthClient struct {
// contains filtered or unexported fields
}
HealthClient provides methods to query health info from the API server.
func NewHealthClient ¶
func NewHealthClient(client *Client) *HealthClient
NewHealthClient creates a new health client.
func (*HealthClient) GetAPIServerCapacity ¶
func (h *HealthClient) GetAPIServerCapacity() (float64, int64, error)
GetAPIServerCapacity returns server-cached single-node capacity (CPU cores, memory bytes). It queries the API server health with IncludeChecks and parses the capacity check.
func (*HealthClient) GetHealth ¶
func (h *HealthClient) GetHealth(componentType, name, namespace string, includeChecks bool) (*generated.GetHealthResponse, error)
GetHealth queries health for a component type
type InstanceClient ¶
type InstanceClient struct {
// contains filtered or unexported fields
}
InstanceClient provides methods for interacting with instances on the Rune API server.
func NewInstanceClient ¶
func NewInstanceClient(client *Client) *InstanceClient
NewInstanceClient creates a new instance client.
func (*InstanceClient) GetInstance ¶
func (i *InstanceClient) GetInstance(namespace, id string) (*types.Instance, error)
GetInstance retrieves an instance by ID.
func (*InstanceClient) ListInstances ¶
func (i *InstanceClient) ListInstances(namespace, serviceID, labelSelector, fieldSelector string) ([]*types.Instance, error)
ListInstances lists instances in a namespace with optional filtering.
func (*InstanceClient) RestartInstance ¶
func (i *InstanceClient) RestartInstance(namespace, id string, timeout time.Duration) error
RestartInstance restarts an instance.
func (*InstanceClient) StartInstance ¶
func (i *InstanceClient) StartInstance(namespace, id string) error
StartInstance starts an instance.
func (*InstanceClient) StopInstance ¶
func (i *InstanceClient) StopInstance(namespace, id string, timeout time.Duration) error
StopInstance stops an instance.
func (*InstanceClient) WatchInstances ¶
func (i *InstanceClient) WatchInstances(namespace, serviceID, labelSelector, fieldSelector string) (<-chan InstanceWatchEvent, error)
WatchInstances watches instances for changes and returns a channel of events. Note: This simulates watch by polling the list endpoint, since we need to regenerate the protobuf code to include the new WatchInstances API.
type InstanceWatchEvent ¶
type InstanceWatchEvent struct {
Instance *types.Instance
EventType string // "ADDED", "MODIFIED", "DELETED"
Error error
}
InstanceWatchEvent represents an instance change event
type LogClient ¶
type LogClient struct {
// contains filtered or unexported fields
}
LogClient provides methods for interacting with logs on the Rune API server.
func NewLogClient ¶
NewLogClient creates a new log client.
func (*LogClient) StreamLogs ¶
StreamLogs creates a bidirectional stream for log streaming. This is a convenience method that wraps the underlying gRPC StreamLogs call.
type NamespaceClient ¶
type NamespaceClient struct {
// contains filtered or unexported fields
}
NamespaceClient provides methods for interacting with namespaces on the Rune API server.
func NewNamespaceClient ¶
func NewNamespaceClient(client *Client) *NamespaceClient
NewNamespaceClient creates a new namespace client.
func (*NamespaceClient) CreateNamespace ¶
func (n *NamespaceClient) CreateNamespace(namespace *types.Namespace) error
CreateNamespace creates a new namespace on the API server.
func (*NamespaceClient) DeleteNamespace ¶
func (n *NamespaceClient) DeleteNamespace(name string, ignoreNotFound, force bool) error
DeleteNamespace deletes a namespace by name.
func (*NamespaceClient) GetLogger ¶
func (n *NamespaceClient) GetLogger() log.Logger
GetLogger returns the logger for this client
func (*NamespaceClient) GetNamespace ¶
func (n *NamespaceClient) GetNamespace(name string) (*types.Namespace, error)
GetNamespace retrieves a namespace by name.
func (*NamespaceClient) ListNamespaces ¶
func (n *NamespaceClient) ListNamespaces(labelSelector, fieldSelector map[string]string) ([]*types.Namespace, error)
ListNamespaces lists all namespaces with optional filtering.
func (*NamespaceClient) WatchNamespaces ¶
func (n *NamespaceClient) WatchNamespaces(labelSelector, fieldSelector map[string]string) (<-chan *types.Namespace, error)
WatchNamespaces watches for namespace changes.
type SecretClient ¶
type SecretClient struct {
// contains filtered or unexported fields
}
SecretClient provides methods for interacting with secrets on the Rune API server.
func NewSecretClient ¶
func NewSecretClient(client *Client) *SecretClient
NewSecretClient creates a new secret client.
func (*SecretClient) CreateSecret ¶
func (s *SecretClient) CreateSecret(secret *types.Secret, ensureNamespace bool) error
CreateSecret creates a new secret on the API server.
func (*SecretClient) DeleteSecret ¶
func (s *SecretClient) DeleteSecret(namespace, name string) error
DeleteSecret deletes a secret.
func (*SecretClient) GetLogger ¶
func (s *SecretClient) GetLogger() log.Logger
GetLogger returns the logger for this client
func (*SecretClient) GetSecret ¶
func (s *SecretClient) GetSecret(namespace, name string) (*types.Secret, error)
GetSecret retrieves a secret by name.
func (*SecretClient) ListSecrets ¶
func (s *SecretClient) ListSecrets(namespace string, labelSelector string, fieldSelector string) ([]*types.Secret, error)
ListSecrets lists secrets in a namespace.
func (*SecretClient) UpdateSecret ¶
func (s *SecretClient) UpdateSecret(secret *types.Secret, force bool) error
UpdateSecret updates an existing secret.
type ServiceClient ¶
type ServiceClient struct {
// contains filtered or unexported fields
}
ServiceClient provides methods for interacting with services on the Rune API server.
func NewServiceClient ¶
func NewServiceClient(client *Client) *ServiceClient
NewServiceClient creates a new service client.
func (*ServiceClient) CreateService ¶
func (s *ServiceClient) CreateService(service *types.Service, ensureNamespace bool) error
CreateService creates a new service on the API server.
func (*ServiceClient) DeleteService ¶
func (s *ServiceClient) DeleteService(namespace, name string) error
DeleteService deletes a service by name.
func (*ServiceClient) DeleteServiceWithRequest ¶
func (s *ServiceClient) DeleteServiceWithRequest(req *generated.DeleteServiceRequest) (*generated.DeleteServiceResponse, error)
DeleteServiceWithRequest deletes a service with the full request object.
func (*ServiceClient) GetDeletionStatus ¶
func (s *ServiceClient) GetDeletionStatus(namespace, name string) (*generated.GetDeletionStatusResponse, error)
GetDeletionStatus gets the status of a deletion operation.
func (*ServiceClient) GetLogger ¶
func (s *ServiceClient) GetLogger() log.Logger
GetLogger returns the logger for this client
func (*ServiceClient) GetService ¶
func (s *ServiceClient) GetService(namespace, name string) (*types.Service, error)
GetService retrieves a service by name.
func (*ServiceClient) ListDeletionOperations ¶
func (s *ServiceClient) ListDeletionOperations(namespace, status string) (*generated.ListDeletionOperationsResponse, error)
ListDeletionOperations lists all deletion operations.
func (*ServiceClient) ListInstances ¶
func (s *ServiceClient) ListInstances(req *generated.ListInstancesRequest) (*generated.ListInstancesResponse, error)
ListInstances lists instances for a service.
func (*ServiceClient) ListServices ¶
func (s *ServiceClient) ListServices(namespace string, labelSelector string, fieldSelector string) ([]*types.Service, error)
ListServices lists services in a namespace with optional filtering.
func (*ServiceClient) ScaleService ¶
func (s *ServiceClient) ScaleService(namespace, name string, scale int) error
ScaleService changes the scale of a service.
func (*ServiceClient) ScaleServiceWithRequest ¶
func (s *ServiceClient) ScaleServiceWithRequest(req *generated.ScaleServiceRequest) (*generated.ServiceResponse, error)
ScaleServiceWithRequest changes the scale of a service with the full request object.
func (*ServiceClient) UpdateService ¶
func (s *ServiceClient) UpdateService(service *types.Service, force bool) error
UpdateService updates an existing service.
func (*ServiceClient) WatchScaling ¶
func (s *ServiceClient) WatchScaling(namespace, name string, targetScale int) (<-chan *generated.ScalingStatusResponse, context.CancelFunc, error)
WatchScaling observes the scaling progress of a service and returns a channel of status updates. The caller should close the cancel function when done watching to prevent resource leaks.
func (*ServiceClient) WatchServices ¶
func (s *ServiceClient) WatchServices(namespace string, labelSelector string, fieldSelector string) (<-chan WatchEvent, context.CancelFunc, error)
WatchServices watches services for changes and returns a channel of events. The caller should call the cancel function when done watching to prevent resource leaks.