yaml

package
v0.0.0-...-eb69673 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Assertions

type Assertions struct {
	Successes []string `yaml:"successes"`
	Fails     []string `yaml:"fails"`
	Lines     int      `yaml:"lines"`
	Timeout   string   `yaml:"timeout"`
}

func (Assertions) Clone

func (a Assertions) Clone() *Assertions

func (Assertions) GetLines

func (a Assertions) GetLines() int

func (Assertions) GetTimeout

func (a Assertions) GetTimeout() time.Duration

func (*Assertions) Initialize

func (a *Assertions) Initialize(doValidator bool) error

func (Assertions) IsSuccess

func (a Assertions) IsSuccess(keyword string) bool

func (Assertions) Keywords

func (a Assertions) Keywords() []string

type Build

type Build struct {
	Git             string            `yaml:"git"`
	Branch          string            `yaml:"branch"`
	Tag             string            `yaml:"tag"`
	TargetFolder    string            `yaml:"target"`
	Scripts         []string          `yaml:"scripts"`
	AdditionalFiles []string          `yaml:"additionalFiles"`
	Env             map[string]string `yaml:"env"`
}

func (Build) Clone

func (y Build) Clone() *Build

func (*Build) Initialize

func (y *Build) Initialize() error

type CI

type CI struct {
	Variables     map[string]string   `yaml:"variables"`
	CommonEnvs    map[string]string   `yaml:"commonEnvs"`
	ThirdServices map[string]*Service `yaml:"thirdServices"`
	Services      map[string]*Service `yaml:"services"`
	Registry      *Registry           `yaml:"registry"`
	Credentials   []*Credential       `yaml:"credentials"`
	Metadata      map[string]string   `yaml:"metadata"`
	CIName        string              `yaml:"name"`
	Namespace     string              `yaml:"namespace"`
	// contains filtered or unexported fields
}

func NewCI

func NewCI(name string) *CI

func OpenCI

func OpenCI(path string, doValidate bool) (ci *CI, err error)

func (*CI) AddOrUpdateService

func (y *CI) AddOrUpdateService(service *Service)

func (CI) Clone

func (y CI) Clone() *CI

func (CI) GetContainerName

func (y CI) GetContainerName(serviceName string) string

func (CI) GetCredential

func (y CI) GetCredential(name string, ref *string) *Credential

func (CI) GetMetadata

func (y CI) GetMetadata(key string) string

func (CI) GetSequencedContainerNames

func (y CI) GetSequencedContainerNames() []string

func (CI) GetService

func (y CI) GetService(name string) *Service

func (*CI) Initialize

func (y *CI) Initialize(doValidate bool) error

func (CI) Name

func (y CI) Name() string

func (*CI) RemoveService

func (y *CI) RemoveService(service *Service)

func (*CI) SetMetadata

func (y *CI) SetMetadata(key, value string)

type Credential

type Credential struct {
	Host     string `yaml:"host"`
	UserName string `yaml:"userName"`
	Password string `yaml:"password"`
}

func (Credential) Clone

func (c Credential) Clone() *Credential

func (Credential) Match

func (c Credential) Match(name string, ref *string) bool

func (Credential) Validate

func (c Credential) Validate() error

type DataSource

func (DataSource) Clone

func (ds DataSource) Clone() DataSource

type DataSourceFolder

type DataSourceFolder string

type DataSourceName

type DataSourceName string

type Deployment

type Deployment struct {
	Args          []string          `yaml:"args"`
	Env           map[string]string `yaml:"env"`
	ServiceName   string            `yaml:"serviceName"`
	ContainerName string            `yaml:"containerName"`
	ContainerID   string            `yaml:"containerID"`
	DockerImageID string            `yaml:"dockerImageID"`
	ExposedPorts  ExposedPorts      `yaml:"exposedPorts"`
	Mounts        Mounts            `yaml:"mounts"`
}

func CreateDeployment

func CreateDeployment(serviceName, containerID, containerName, dockerImageID string, args []string, env map[string]string, exposedPorts ExposedPorts, mounts Mounts) *Deployment

func ReadDeployment

func ReadDeployment(path string) (*Deployment, error)

func (Deployment) Equals

func (d Deployment) Equals(args []string, env map[string]string, exposedPorts ExposedPorts, mounts Mounts) bool

func (Deployment) SaveToFile

func (d Deployment) SaveToFile(fileName string) error

type ExposedPort

type ExposedPort struct {
	HostIP   string `yaml:"hostIP"`
	HostPort int    `yaml:"hostPort"`
	// contains filtered or unexported fields
}

func (ExposedPort) Clone

func (y ExposedPort) Clone() *ExposedPort

func (*ExposedPort) Validate

func (y *ExposedPort) Validate(portName PortName) error

type ExposedPorts

type ExposedPorts map[PortName]*ExposedPort

type Image

type Image struct {
	Name       string `yaml:"name"`
	Ref        string `yaml:"ref"`
	DockerFile string `yaml:"dockerFile"`
}

func (Image) Clone

func (y Image) Clone() *Image

func (*Image) String

func (y *Image) String() string

func (*Image) Validate

func (y *Image) Validate() error

type Manifest

type Manifest struct {
	HeadHash        string            `yaml:"headHash"`
	Files           []*ManifestFile   `yaml:"files"`
	Scripts         []string          `yaml:"scripts"`
	AdditionalFiles []string          `yaml:"additionalFiles"`
	BuildEnvs       map[string]string `yaml:"buildEnvs"`
	DockerImageID   *string           `yaml:"dockerImageID"`
	Image           *Image            `yaml:"image"`
	// contains filtered or unexported fields
}

func CreateManifest

func CreateManifest(build *Build, targetPath string, headHash [20]byte) (*Manifest, error)

func ReadManifest

func ReadManifest(path string) (*Manifest, error)

func (*Manifest) ApplyImage

func (m *Manifest) ApplyImage(imageID string, image *Image)

func (Manifest) BuildEquals

func (m Manifest) BuildEquals(build *Build) bool

func (Manifest) CheckCRC

func (m Manifest) CheckCRC() (bool, error)

func (Manifest) FilesCount

func (m Manifest) FilesCount() int

func (Manifest) HeadEquals

func (m Manifest) HeadEquals(headHash [20]byte) bool

func (Manifest) ImageEquals

func (m Manifest) ImageEquals(image *Image) bool

func (Manifest) SaveToFile

func (m Manifest) SaveToFile(fileName string) error

type ManifestFile

type ManifestFile struct {
	Path string `yaml:"path"`
	CRC  string `yaml:"crc"`
}

type MountContainerPath

type MountContainerPath string

type MountHostPath

type MountHostPath string

type Mounts

type PortName

type PortName string

type Registry

type Registry struct {
	Type    string `yaml:"type"`
	Address string `yaml:"address"`
	Port    int    `yaml:"port"`
	UseSSL  bool   `yaml:"useSSL"`
}

type Service

type Service struct {
	BaseService      string            `yaml:"baseService"`
	Image            *Image            `yaml:"image"`
	ExposedPorts     ExposedPorts      `yaml:"exposedPorts"`
	Env              map[string]string `yaml:"env"`
	Mounts           Mounts            `yaml:"mounts"`
	Args             []string          `yaml:"args"`
	Build            *Build            `yaml:"build"`
	MetaData         map[string]string `yaml:"metadata"`
	Assertions       *Assertions       `yaml:"assertions"`
	DependsOn        []string          `yaml:"dependsOn"`
	Tags             map[string]string `yaml:"tags"`
	DataSource       DataSource        `yaml:"dataSource"`
	DisableCommonEnv bool              `yaml:"disableCommonEnv"`
	// contains filtered or unexported fields
}

func (*Service) ApplyBaseService

func (y *Service) ApplyBaseService(baseService *Service)

func (Service) Clone

func (y Service) Clone() *Service

func (Service) Equals

func (y Service) Equals(serviceYaml *Service, git, build, image bool) (equals bool)

func (Service) HasBaseService

func (y Service) HasBaseService() bool

func (*Service) Initialize

func (y *Service) Initialize(name string, isThird, doValidate bool) error

func (*Service) IsThird

func (y *Service) IsThird() bool

func (Service) Name

func (y Service) Name() string

Jump to

Keyboard shortcuts

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