Documentation
¶
Index ¶
- Variables
- func LogQueryWindow(cursor *time.Time, direction api.LogsDirection) (time.Time, time.Time)
- type Cluster
- func (c *Cluster) Close(ctx context.Context) error
- func (c *Cluster) GetAvailableTemplateBuilder(ctx context.Context, expectedInfo machineinfo.MachineInfo) (*Instance, error)
- func (c *Cluster) GetByServiceInstanceID(serviceInstanceID string) (*Instance, bool)
- func (c *Cluster) GetOrchestrators() []*Instance
- func (c *Cluster) GetResources() ClusterResource
- func (c *Cluster) GetTemplateBuilderByNodeID(nodeID string) (*Instance, error)
- func (c *Cluster) SyncInstances(ctx context.Context) error
- type ClusterResource
- type ClusterResourceProviderImpl
- func (r *ClusterResourceProviderImpl) GetBuildLogs(ctx context.Context, nodeID *string, templateID string, buildID string, ...) ([]logs.LogEntry, *api.APIError)
- func (r *ClusterResourceProviderImpl) GetSandboxLogs(ctx context.Context, teamID string, sandboxID string, start *int64, end *int64, ...) (api.SandboxLogs, *api.APIError)
- func (r *ClusterResourceProviderImpl) GetSandboxMetrics(ctx context.Context, teamID string, sandboxID string, qStart *int64, ...) ([]api.SandboxMetric, *api.APIError)
- func (r *ClusterResourceProviderImpl) GetSandboxesMetrics(ctx context.Context, teamID string, sandboxIDs []string) (map[string]api.SandboxMetric, *api.APIError)
- func (r *ClusterResourceProviderImpl) GetVolumeTypes(_ context.Context) ([]string, error)
- type GRPCClient
- type Instance
- type InstanceInfo
- type LocalClusterResourceProvider
- func (l *LocalClusterResourceProvider) GetBuildLogs(ctx context.Context, nodeID *string, templateID string, buildID string, ...) ([]logs.LogEntry, *api.APIError)
- func (l *LocalClusterResourceProvider) GetSandboxLogs(ctx context.Context, teamID string, sandboxID string, qStart *int64, ...) (api.SandboxLogs, *api.APIError)
- func (l *LocalClusterResourceProvider) GetSandboxMetrics(ctx context.Context, teamID string, sandboxID string, qStart *int64, ...) ([]api.SandboxMetric, *api.APIError)
- func (l *LocalClusterResourceProvider) GetSandboxesMetrics(ctx context.Context, teamID string, sandboxIDs []string) (map[string]api.SandboxMetric, *api.APIError)
- type Pool
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrTemplateBuilderNotFound = errors.New("template builder not found") ErrAvailableTemplateBuilderNotFound = errors.New("available template builder not found") )
Functions ¶
func LogQueryWindow ¶
Types ¶
type Cluster ¶
type Cluster struct {
ID uuid.UUID
SandboxDomain *string
AuthOrgID string
// contains filtered or unexported fields
}
func NewCluster ¶
func NewCluster( clusterID uuid.UUID, domain *string, authOrgID string, sandboxes *smap.Map[*Instance], synchronization *synchronization.Synchronize[discovery.Item, *Instance], resources ClusterResource, ) *Cluster
func (*Cluster) GetAvailableTemplateBuilder ¶
func (c *Cluster) GetAvailableTemplateBuilder(ctx context.Context, expectedInfo machineinfo.MachineInfo) (*Instance, error)
func (*Cluster) GetByServiceInstanceID ¶
func (*Cluster) GetOrchestrators ¶
func (*Cluster) GetResources ¶
func (c *Cluster) GetResources() ClusterResource
func (*Cluster) GetTemplateBuilderByNodeID ¶
func (*Cluster) SyncInstances ¶
SyncInstances performs an immediate synchronization of cluster instances from the service discovery source. It is called on-demand when a node lookup fails, to handle newly joined orchestrators that may not yet be in the in-memory pool.
type ClusterResource ¶
type ClusterResource interface {
GetSandboxMetrics(ctx context.Context, teamID string, sandboxID string, qStart *int64, qEnd *int64) ([]api.SandboxMetric, *api.APIError)
GetSandboxesMetrics(ctx context.Context, teamID string, sandboxIDs []string) (map[string]api.SandboxMetric, *api.APIError)
GetSandboxLogs(ctx context.Context, teamID string, sandboxID string, start *int64, end *int64, limit *int32, direction *api.LogsDirection, level *logs.LogLevel, search *string) (api.SandboxLogs, *api.APIError)
GetBuildLogs(ctx context.Context, nodeID *string, templateID string, buildID string, offset int32, limit int32, level *logs.LogLevel, cursor *time.Time, direction api.LogsDirection, source *api.LogsSource) ([]logs.LogEntry, *api.APIError)
}
type ClusterResourceProviderImpl ¶
type ClusterResourceProviderImpl struct {
// contains filtered or unexported fields
}
func (*ClusterResourceProviderImpl) GetBuildLogs ¶
func (*ClusterResourceProviderImpl) GetSandboxLogs ¶
func (*ClusterResourceProviderImpl) GetSandboxMetrics ¶
func (*ClusterResourceProviderImpl) GetSandboxesMetrics ¶
func (r *ClusterResourceProviderImpl) GetSandboxesMetrics(ctx context.Context, teamID string, sandboxIDs []string) (map[string]api.SandboxMetric, *api.APIError)
func (*ClusterResourceProviderImpl) GetVolumeTypes ¶
func (r *ClusterResourceProviderImpl) GetVolumeTypes(_ context.Context) ([]string, error)
type GRPCClient ¶
type GRPCClient struct {
Info infogrpc.InfoServiceClient
Sandbox orchestratorgrpc.SandboxServiceClient
Volumes orchestratorgrpc.VolumeServiceClient
Template templatemanagergrpc.TemplateServiceClient
Connection *grpc.ClientConn
// contains filtered or unexported fields
}
func NewGRPCClient ¶
func NewGRPCClient(conn *grpc.ClientConn, observeTarget string) *GRPCClient
func (*GRPCClient) Close ¶
func (a *GRPCClient) Close() error
func (*GRPCClient) Init ¶
func (a *GRPCClient) Init(ctx context.Context)
type Instance ¶
type Instance struct {
ClusterID uuid.UUID
NodeID string
LocalIPAddress string
// contains filtered or unexported fields
}
func (*Instance) GetClient ¶
func (i *Instance) GetClient() *GRPCClient
func (*Instance) GetInfo ¶
func (i *Instance) GetInfo() InstanceInfo
func (*Instance) GetMachineInfo ¶
func (i *Instance) GetMachineInfo() machineinfo.MachineInfo
type InstanceInfo ¶
type InstanceInfo struct {
ServiceInstanceID string
ServiceVersion string
ServiceVersionCommit string
Status infogrpc.ServiceInfoStatus
IsOrchestrator bool
IsBuilder bool
}
InstanceInfo contains synchronized instance information
type LocalClusterResourceProvider ¶
type LocalClusterResourceProvider struct {
// contains filtered or unexported fields
}
func (*LocalClusterResourceProvider) GetBuildLogs ¶
func (*LocalClusterResourceProvider) GetSandboxLogs ¶
func (*LocalClusterResourceProvider) GetSandboxMetrics ¶
func (*LocalClusterResourceProvider) GetSandboxesMetrics ¶
func (l *LocalClusterResourceProvider) GetSandboxesMetrics(ctx context.Context, teamID string, sandboxIDs []string) (map[string]api.SandboxMetric, *api.APIError)
Source Files
¶
Click to show internal directories.
Click to hide internal directories.