core

package
v0.0.0-...-0adad2b Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EnvPrefix          = "BOSUN_"
	EnvEnvironment     = "BOSUN_ENVIRONMENT"
	EnvEnvironmentRole = "BOSUN_ENVIRONMENT_ROLE"
	EnvCluster         = "BOSUN_CLUSTER"
	EnvStack           = "BOSUN_STACK"
	EnvAppVersion      = "BOSUN_APP_VERSION"
	EnvAppCommit       = "BOSUN_APP_COMMIT"
	EnvAppBranch       = "BOSUN_APP_BRANCH"
	// Variable containing bosun run time environment information,
	// to force child instances of bosun to have the correct environment and cluster
	EnvInternalStack = "BOSUN_INTERNAL_STACK"
)
View Source
const (
	ScriptRun        = "run"
	ScriptBuild      = "build"
	ScriptBuildImage = "buildImage"
	ScriptTest       = "test"
)
View Source
const (
	LabelName       = "name"
	LabelPath       = "path"
	LabelBranch     = "branch"
	LabelCommit     = "commit"
	LabelVersion    = "version"
	LabelDeployable = "deployable"
)
View Source
const (
	KeyCluster         = "cluster"
	KeyStack           = "stack"
	KeyClusterRoles    = "clusterRoles"
	KeyClustersRoles   = "clustersRoles"
	KeyClusterProvider = "clusterProvider"
	KeyNamespace       = "namespace"
	KeyNamespaceRole   = "namespaceRole"
	KeyNamespaceRoles  = "namespaceRoles"
	KeyEnvironment     = "environment"
	KeyEnvironmentRole = "environmentRole"
	KeyAppName         = "appName"
	KeyAppVersion      = "appVersion"
	KeyReleaseVersion  = "releaseVersion"
)

Variables

View Source
var Commit string
View Source
var ErrNotCloned = errors.New("not cloned")
View Source
var Timestamp string
View Source
var Version string

Functions

func CheckCompatibility

func CheckCompatibility(required semver.Version) error

func GetInternalEnvironmentAndCluster

func GetInternalEnvironmentAndCluster() (stack brns.StackBrn, found bool)

func GetVersion

func GetVersion() semver.Version

func SetInternalBrn

func SetInternalBrn(stack brns.StackBrn)

Types

type ClusterRole

type ClusterRole string
const ClusterRoleDefault ClusterRole = "default"

type ClusterRoleDefinition

type ClusterRoleDefinition struct {
	Name        ClusterRole `yaml:"name"`
	Description string      `yaml:"description"`
}

type ClusterRoler

type ClusterRoler interface {
	ClusterRole() ClusterRole
}

type ClusterRoles

type ClusterRoles []ClusterRole

func ClusterRolesFromStrings

func ClusterRolesFromStrings(ss []string) ClusterRoles

func (ClusterRoles) Accepts

func (e ClusterRoles) Accepts(role ClusterRole) bool

Accepts returns true if the list of roles is empty or if it contains the role.

func (ClusterRoles) Contains

func (e ClusterRoles) Contains(role ClusterRole) bool

func (ClusterRoles) MarshalYAML

func (e ClusterRoles) MarshalYAML() (interface{}, error)

func (ClusterRoles) String

func (e ClusterRoles) String() string

func (ClusterRoles) Strings

func (e ClusterRoles) Strings() []string

func (*ClusterRoles) UnmarshalYAML

func (e *ClusterRoles) UnmarshalYAML(unmarshal func(interface{}) error) error

type ConfigShared

type ConfigShared struct {
	FromPath    string    `yaml:"-" json:"fromPath"`
	Name        string    `yaml:"name,omitempty" json:"name"`
	Description string    `yaml:"description,omitempty" json:"description,omitempty"`
	FileSaver   FileSaver `yaml:"-" json:"-"`
}

func (*ConfigShared) ResolveRelative

func (c *ConfigShared) ResolveRelative(path string) string

func (*ConfigShared) SetFileSaver

func (c *ConfigShared) SetFileSaver(p FileSaver)

func (*ConfigShared) SetFromPath

func (c *ConfigShared) SetFromPath(fp string)

type Ctxer

type Ctxer interface {
	Ctx() context.Context
	WithTimeout(timeout time.Duration) Ctxer
}

type EnvironmentRole

type EnvironmentRole string

func (EnvironmentRole) String

func (e EnvironmentRole) String() string

type EnvironmentRoleDefinition

type EnvironmentRoleDefinition struct {
	Name        EnvironmentRole `yaml:"name"`
	Description string          `yaml:"description"`
}

type EnvironmentRoler

type EnvironmentRoler interface {
	EnvironmentRole() EnvironmentRole
}

type EnvironmentRoles

type EnvironmentRoles []EnvironmentRole

func (EnvironmentRoles) Accepts

func (e EnvironmentRoles) Accepts(role EnvironmentRole) bool

Accepts returns true if the list of roles is empty or if it contains the role.

func (EnvironmentRoles) Contains

func (e EnvironmentRoles) Contains(role EnvironmentRole) bool

func (EnvironmentRoles) MarshalYAML

func (e EnvironmentRoles) MarshalYAML() (interface{}, error)

func (EnvironmentRoles) String

func (e EnvironmentRoles) String() string

func (EnvironmentRoles) Strings

func (e EnvironmentRoles) Strings() []string

func (*EnvironmentRoles) UnmarshalYAML

func (e *EnvironmentRoles) UnmarshalYAML(unmarshal func(interface{}) error) error

type FileSaver

type FileSaver interface {
	Save() error
}

type FileSaverSetter

type FileSaverSetter interface {
	SetFileSaver(p FileSaver)
}

type FromPathSetter

type FromPathSetter interface {
	SetFromPath(string)
}

type InterfaceKeyValuer

type InterfaceKeyValuer interface {
	GetValue(key string, defaultValue ...interface{}) interface{}
	WithValue(key string, value interface{}) StringKeyValuer
}

type NamespaceRole

type NamespaceRole string
const NamespaceRoleDefault NamespaceRole = "default"

type NamespaceRoleDefinition

type NamespaceRoleDefinition struct {
	Name        NamespaceRole `yaml:"name"`
	Description string        `yaml:"description"`
}

type NamespaceRoler

type NamespaceRoler interface {
	NamespaceRole() NamespaceRole
}

type NamespaceRoles

type NamespaceRoles []NamespaceRole

func NamespaceRolesFromStrings

func NamespaceRolesFromStrings(ss []string) NamespaceRoles

func (NamespaceRoles) Accepts

func (e NamespaceRoles) Accepts(role NamespaceRole) bool

Accepts returns true if the list of roles is empty or if it contains the role.

func (NamespaceRoles) Contains

func (e NamespaceRoles) Contains(role NamespaceRole) bool

func (NamespaceRoles) MarshalYAML

func (e NamespaceRoles) MarshalYAML() (interface{}, error)

func (NamespaceRoles) String

func (e NamespaceRoles) String() string

func (NamespaceRoles) Strings

func (e NamespaceRoles) Strings() []string

func (*NamespaceRoles) UnmarshalYAML

func (e *NamespaceRoles) UnmarshalYAML(unmarshal func(interface{}) error) error

type PathResolver

type PathResolver interface {
	ResolvePath(path string, expansions ...string) string
}

type StringKeyValuer

type StringKeyValuer interface {
	GetStringValue(key string, defaultValue ...string) string
	WithStringValue(key string, value string) StringKeyValuer
}

type WorkspaceContext

type WorkspaceContext struct {
	EnvironmentName string
	ClusterName     string
	ReleaseSlot     string
}

Jump to

Keyboard shortcuts

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