configmeta

package
v0.0.0-...-bc49051 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// VarRegion is a common env var name.
	VarRegion = "REGION"
	// VarServiceEnv is a common env var name.
	VarServiceEnv = "SERVICE_ENV"
	// VarServiceName is a common env var name.
	VarServiceName = "SERVICE_NAME"
	// VarProjectName is a common env var name.
	VarProjectName = "PROJECT_NAME"
	// VarClusterName is a common env var name.
	VarClusterName = "CLUSTER_NAME"
	// VarPort is a common env var name.
	VarPort = "PORT"
	// VarHostname is a common env var name.
	VarHostname = "HOSTNAME"
	// VarVersion is a common env var name.
	VarVersion = "VERSION"
	// VarGitRef is a common env var name.
	VarGitRef = "GIT_REF"
)

Service specific constants

View Source
const (
	EnvDev  = "dev"
	EnvTest = "test"
	EnvProd = "prod"
)

Environment constants.

View Source
const (
	// DefaultVersion is the default version.
	DefaultVersion = "HEAD"
)

Variables

View Source
var (
	// Version is the current version.
	Version = ""
	// GitRef is the currently deployed git ref
	GitRef = "HEAD"
	// ServiceName is the name of the service
	ServiceName = ""
	// ProjectName is the name of the project the service belongs to
	ProjectName = ""
	// ClusterName is the name of the cluster the service is deployed to
	ClusterName = ""
	// Region is the region the service is deployed to
	Region = ""
)

These are set with `-ldflags="-X` on `go install`

Functions

This section is empty.

Types

type Meta

type Meta struct {
	// Region is the aws region the service is deployed to.
	Region string `json:"region,omitempty" yaml:"region,omitempty"`
	// ServiceName is name of the service
	ServiceName string `json:"serviceName,omitempty" yaml:"serviceName,omitempty"`
	// ProjectName is the project name injected by Deployinator.
	ProjectName string `json:"projectName,omitempty" yaml:"projectName,omitempty"`
	// ClusterName is the name of the cluster the service is deployed to
	ClusterName string `json:"clusterName,omitempty" yaml:"clusterName,omitempty"`
	// Environment is the environment of the cluster (sandbox, prod etc.)
	ServiceEnv string `json:"serviceEnv,omitempty" yaml:"serviceEnv,omitempty"`
	// Hostname is the environment of the cluster (sandbox, prod etc.)
	Hostname string `json:"hostname,omitempty" yaml:"hostname,omitempty"`
	// Version is the application version.
	Version string `json:"version,omitempty" yaml:"version,omitempty"`
	// GitRef is the git ref of the image.
	GitRef string `json:"gitRef,omitempty" yaml:"gitRef,omitempty"`
}

Meta is the cluster config meta.

func (*Meta) ApplyTo

func (m *Meta) ApplyTo(other *Meta) configutil.ResolveAction

ApplyTo applies a given meta to another meta.

func (Meta) IsProdlike

func (m Meta) IsProdlike() bool

IsProdlike returns if the ServiceEnv is prodlike, that is an environment where we care about secrets leaking.

func (*Meta) Resolve

func (m *Meta) Resolve(ctx context.Context) error

Resolve implements configutil.Resolver

func (*Meta) SetFrom

func (m *Meta) SetFrom(other *Meta) configutil.ResolveAction

SetFrom returns a resolve action to set this meta from a root meta.

Jump to

Keyboard shortcuts

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