data

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 9, 2019 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Handles interfacing with the data store.

Index

Constants

This section is empty.

Variables

View Source
var ErrNoSuchNamespaceOrKey = errors.New("No such namespace or key")

Functions

This section is empty.

Types

type Client

type Client interface {
	Config() (*types.Config, error)

	Mode() (types.Mode, error)
	SetMode(types.Mode) error

	Options() (*types.Options, error)
	SetOptions(*types.Options) error

	InCloseTime() (bool, error)
	IsTrainAutoCloseable(*types.Train) (bool, error)

	Train(uint64) (*types.Train, error)
	LatestTrain() (*types.Train, error)
	LatestTrainForBranch(string) (*types.Train, error)
	CreateTrain(string, *types.User, []*types.Commit) (*types.Train, error)
	ExtendTrain(*types.Train, *types.User, []*types.Commit) error
	DuplicateTrain(*types.Train, []*types.Commit) (*types.Train, error)
	ChangeTrainEngineer(*types.Train, *types.User) error
	CloseTrain(*types.Train, bool) error
	OpenTrain(*types.Train, bool) error
	BlockTrain(*types.Train, *string) error
	UnblockTrain(*types.Train) error
	DeployTrain(*types.Train) error
	CancelTrain(*types.Train) error
	LoadLastDeliveredSHA(*types.Train) error

	Phase(uint64, *types.Train) (*types.Phase, error)
	StartPhase(*types.Phase) error
	ErrorPhase(*types.Phase, error) error
	UncompletePhase(*types.Phase) error
	CompletePhase(*types.Phase) error
	ReplacePhase(*types.Phase) (*types.Phase, error)

	CreateJob(*types.Phase, string) (*types.Job, error)
	StartJob(*types.Job, string) error
	CompleteJob(*types.Job, types.JobResult, string) error
	RestartJob(*types.Job, string) error

	WriteCommits([]*types.Commit) ([]*types.Commit, error)
	LatestCommitForTrain(*types.Train) (*types.Commit, error)
	TrainsByCommit(*types.Commit) ([]*types.Train, error)

	WriteToken(newToken, name, email, avatar, codeToken string) error
	RevokeToken(oldToken, email string) error
	ReadOrCreateUser(name, email string) (*types.User, error)
	UserByToken(token string) (*types.User, error)

	WriteTickets([]*types.Ticket) error
	UpdateTickets([]*types.Ticket) error

	MetadataListNamespaces() ([]string, error)
	MetadataListKeys(string) ([]string, error)
	MetadataGetKey(string, string) (string, error)
	MetadataSet(string, map[string]string) error
	MetadataDeleteNamespace(string) error
	MetadataDeleteKey(string, string) error
}

func NewClient

func NewClient() Client

type Postgres

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

func (*Postgres) Client

func (d *Postgres) Client() Client

type Service

type Service interface {
	Client() Client
}

func GetService

func GetService() Service

Jump to

Keyboard shortcuts

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