tissue

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrCastToGitlabStorage = errors.New("cannot cast storage to gitlabCellsStorage")
View Source
var ErrUnknownAmp = errors.New("unknown APM cluster")

Functions

This section is empty.

Types

type AmpCluster

type AmpCluster string
const (
	TestCluster AmpCluster = AmpCluster("test")
	DevCluster  AmpCluster = AmpCluster("cellsdev")
	ProdCluster AmpCluster = AmpCluster("cellsprod")
)

func WellKnownAmpCluster

func WellKnownAmpCluster(name string) (AmpCluster, error)

func WellKnownAmpClusters

func WellKnownAmpClusters() []AmpCluster

func (*AmpCluster) Ring

func (a *AmpCluster) Ring(nr uint) *ClusterRing

func (*AmpCluster) RingsPath

func (a *AmpCluster) RingsPath() string

type CellsStorage

type CellsStorage interface {
	Update(ring Ring, cells []*cell.Cell, action CellsAction, commitMsg string) error
	List(ring Ring) ([]*cell.Cell, error)
}

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(config *Config) (*Client, error)

func (*Client) GetPipeline

func (c *Client) GetPipeline(id int) (*Pipeline, error)

func (*Client) ListCells

func (c *Client) ListCells(ring Ring) ([]*cell.Cell, error)

func (*Client) Patch

func (c *Client) Patch(ring Ring, buff []byte) error

Patch loads buff into a jsonpatch.Patch and applies it to the whole ring.

func (*Client) RemoveCell

func (c *Client) RemoveCell(ring Ring, model *cell.Cell) error

func (*Client) RingDeployment

func (c *Client) RingDeployment(ring Ring, onlyGitlabUpgrades bool) (*Pipeline, error)

func (*Client) TearDownCell

func (c *Client) TearDownCell(ring Ring, cell *cell.Cell) (*Pipeline, error)

func (*Client) UploadCell

func (c *Client) UploadCell(ring Ring, model *cell.Cell) error

func (*Client) UploadCells

func (c *Client) UploadCells(ring Ring, cells []*cell.Cell, commitMsg string) error

type Cluster

type Cluster interface {
	RingsPath() string
	Ring(nr uint) *ClusterRing
}

type ClusterRing

type ClusterRing struct {
	ClusterName string
	RingsPath   string
	Nr          uint
}

func (*ClusterRing) AmpCluster

func (r *ClusterRing) AmpCluster() string

func (*ClusterRing) CellPath

func (r *ClusterRing) CellPath(fileName string) string

func (*ClusterRing) Number

func (r *ClusterRing) Number() uint

func (*ClusterRing) Path

func (r *ClusterRing) Path() string

func (*ClusterRing) String

func (r *ClusterRing) String() string

type Config

type Config struct {
	Token      string
	Instance   string
	Project    string
	Branch     string
	AmpCluster string
	DryRun     bool
	Local      bool
	Version    string
}

type LocalDiskStorage

type LocalDiskStorage struct {
}

func (*LocalDiskStorage) List

func (l *LocalDiskStorage) List(ring Ring) ([]*cell.Cell, error)

func (*LocalDiskStorage) Update

func (l *LocalDiskStorage) Update(ring Ring, cells []*cell.Cell, action CellsAction, commitMsg string) error

type Pipeline

type Pipeline struct {
	ID     int
	WebURL string
	Status string
}

type Ring

type Ring interface {
	fmt.Stringer
	AmpCluster() string
	Path() string
	CellPath(fileName string) string
	Number() uint
}

type UnknownActionError

type UnknownActionError struct {
	Action CellsAction
}

func (*UnknownActionError) Error

func (e *UnknownActionError) Error() string

Jump to

Keyboard shortcuts

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