cluster

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 3, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Index

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

func Create

func Create(uuid, name, endpoint, token, cert string, timestamp int64) (*Cluster, error)

Create handles create commands

func Replay

func Replay(events []ddd.Event) *Cluster

Replay recreates the cluster from a series of events

func (*Cluster) Cert

func (c *Cluster) Cert() string

Cert returns the cluster's cert info

func (*Cluster) Destroy

func (c *Cluster) Destroy(timestamp int64) error

Destroy handles destroy commands

func (*Cluster) Endpoint

func (c *Cluster) Endpoint() string

Endpoint returns this cluster's endpoint

func (*Cluster) Events

func (c *Cluster) Events() []ddd.Event

Events returns this cluster's event history

func (*Cluster) Name

func (c *Cluster) Name() string

Name returns this cluster's name

func (*Cluster) Token

func (c *Cluster) Token() string

Token returns this cluster's access token

func (*Cluster) UUID

func (c *Cluster) UUID() string

UUID returns this cluster's identifier

func (*Cluster) Update

func (c *Cluster) Update(name, endpoint, token, cert string, timestamp int64) error

Update handles update commands

func (*Cluster) Version

func (c *Cluster) Version() int

Version returns this cluster's version number (NOTE: aggregate version!)

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

func (Created) EventType

func (e Created) EventType() string

EventType marks this as an event

type Destroyed

type Destroyed struct {
	Timestamp int64
}

Destroyed is the event for when a cluster is destroyed

func (Destroyed) EventType

func (e Destroyed) EventType() string

EventType marks this as an event

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

func NewService(a auth.Agent, k kube.Agent, s storage.Storage) *Service

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

type Updated

type Updated struct {
	Timestamp int64
	Name      string
	Endpoint  string
	Token     string
	Cert      string
}

Updated is the event for when a cluster is updated

func (Updated) EventType

func (e Updated) EventType() string

EventType marks this as an event

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL