Documentation ¶
Index ¶
- type Cluster
- func (c *Cluster) Cert() string
- func (c *Cluster) Destroy(timestamp int64) error
- func (c *Cluster) Endpoint() string
- func (c *Cluster) Events() []ddd.Event
- func (c *Cluster) Name() string
- func (c *Cluster) Token() string
- func (c *Cluster) UUID() string
- func (c *Cluster) Update(name, endpoint, token, cert string, timestamp int64) error
- func (c *Cluster) Version() int
- type Created
- type Destroyed
- type Repository
- type Service
- func (s Service) All(ctx context.Context, req *pb.ReadClusters) (*pb.ClustersRead, error)
- func (s Service) Create(ctx context.Context, cmd *pb.CreateCluster) (*pb.ClusterCreated, error)
- func (s Service) Destroy(ctx context.Context, cmd *pb.DestroyCluster) (*pb.ClusterDestroyed, error)
- func (s Service) Read(ctx context.Context, req *pb.ReadCluster) (*pb.ClusterRead, error)
- func (s Service) Update(ctx context.Context, cmd *pb.UpdateCluster) (*pb.ClusterUpdated, error)
- type Updated
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cluster ¶
type Cluster struct {
// contains filtered or unexported fields
}
Cluster represents a kubernetes cluster we are monitoring/deploying to
type Created ¶
type Created struct { Timestamp int64 UUID string Name string Endpoint string Token string Cert string }
Created is the event for when a new cluster is created
type Destroyed ¶
type Destroyed struct {
Timestamp int64
}
Destroyed is the event for when a cluster is destroyed
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
Repository is the repository for dealing with cluster storage
func NewRepository ¶
func NewRepository(coll string, store storage.Storage) *Repository
NewRepository creates a repository with the given storage
func (*Repository) All ¶
func (r *Repository) All() ([]*Cluster, error)
All gets all clusters, excluding deleted items
func (*Repository) Load ¶
func (r *Repository) Load(uuid string) (*Cluster, error)
Load reads out the cluster for the uuid given
func (*Repository) Save ¶
func (r *Repository) Save(c *Cluster) error
Save persists the new events for the cluster given
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is the implementation for twirp to use
func NewService ¶
NewService creates the service
func (Service) All ¶
func (s Service) All(ctx context.Context, req *pb.ReadClusters) (*pb.ClustersRead, error)
All gets all clusters currently configured and their status
func (Service) Create ¶
func (s Service) Create(ctx context.Context, cmd *pb.CreateCluster) (*pb.ClusterCreated, error)
Create adds a cluster to the list of configurations
func (Service) Destroy ¶
func (s Service) Destroy(ctx context.Context, cmd *pb.DestroyCluster) (*pb.ClusterDestroyed, error)
Destroy removes a cluster from the list of configurations
func (Service) Read ¶
func (s Service) Read(ctx context.Context, req *pb.ReadCluster) (*pb.ClusterRead, error)
Read reads out a cluster
func (Service) Update ¶
func (s Service) Update(ctx context.Context, cmd *pb.UpdateCluster) (*pb.ClusterUpdated, error)
Update edits an already existing cluster