Documentation ¶
Index ¶
- Variables
- func IsCI() bool
- func IsCircleCI() bool
- func IsGithubCI() bool
- func IsGithubRepo() bool
- func IsGitlabCI() bool
- func IsGitlabRepo() bool
- type CircleCIEnv
- type Context
- type ContextMap
- type GithubEnv
- type GithubSource
- type GitlabEnv
- type GitlabSource
- type LocalSource
- type RuntimeContext
- type Source
- type SourceMeta
- type SourceType
- type StringMap
Constants ¶
This section is empty.
Variables ¶
var SourceTypeToString = map[SourceType]string{ // contains filtered or unexported fields }
Functions ¶
func IsCircleCI ¶ added in v0.6.0
func IsCircleCI() bool
IsCircleCI indicates whether the CLI is run from a Gitlab pipeline job
func IsGithubCI ¶
func IsGithubCI() bool
IsGithubCI indicates whether the CLI is run from a Github worflow
func IsGithubRepo ¶
func IsGithubRepo() bool
IsGithubRepo indicates whether the CLI is run against a github repo
func IsGitlabCI ¶
func IsGitlabCI() bool
IsGitlabCI indicates whether the CLI is run from a Gitlab pipeline job
func IsGitlabRepo ¶
func IsGitlabRepo() bool
IsGitlabRepo indicates whether the CLI is run against a gitlab repo
Types ¶
type CircleCIEnv ¶ added in v0.6.0
type CircleCIEnv StringMap
CircleCIEnv is a map of targeted CircleCI env variables set when running the CLI via a CircleCI workflow
func GetCircleCIEnv ¶ added in v0.6.0
func GetCircleCIEnv() CircleCIEnv
GetCircleCIEnv returns a map of CircleCI env variables
type Context ¶
type Context struct { IsCI bool `json:"ci"` Runtime *RuntimeContext `json:"runtime"` Environ StringMap `json:"environ"` Context ContextMap `json:"context"` Source interface{} `json:"source"` // can be one of Local, Github, Gitlab sources }
Context contains all execution data useful to Reliably when running the CLI
func NewContext ¶
func NewContext() *Context
NewContext is a constructor to initialize a full context for Reliably
type GithubEnv ¶
type GithubEnv StringMap
GithubEnv is a map of targeted GitHub env variables set when running the CLI via a Github workflow
func GetGithubEnv ¶
func GetGithubEnv() GithubEnv
GetGithubEnv returns a map of GitHub env variables
type GithubSource ¶
type GithubSource struct {
Type SourceType `json:"type"`
}
GithubSource represents a GitHub repository
type GitlabEnv ¶
type GitlabEnv StringMap
GitlabEnv is a map of targeted Gitlab env variables set when running the CLI via a Gitlab workflow
func GetGitlabEnv ¶
func GetGitlabEnv() GitlabEnv
GetGitlabEnv returns a map of Gitlab env variables
type GitlabSource ¶
type GitlabSource struct {
Type SourceType `json:"type"`
}
GitlabSource represents a Gitlab project
type LocalSource ¶
type LocalSource struct {
Type SourceType `json:"type"`
}
LocalSource represents a local folder
type RuntimeContext ¶
type RuntimeContext struct { Datetime time.Time `json:"datetime"` Username string `json:"username"` Hostname string `json:"hostname"` WorkingDir string `json:"workingdir"` Command []string `json:"command"` OS string `json:"os"` Arch string `json:"arch"` }
RuntimeContext holds the metadata of the environment running the CLI
func NewRuntimeContext ¶
func NewRuntimeContext() *RuntimeContext
NewRuntimeContext is a constructor to initialize a CLI execution context
type Source ¶
type Source struct { Type SourceType `json:"type"` Hash string `json:"hash"` Meta SourceMeta `json:"meta"` }
Source is the base interface for a source files to be checked by CLI
func NewGitSource ¶
func (*Source) ComputeHash ¶
func (s *Source) ComputeHash()
ComputeHash computes the hash of the source meta
type SourceMeta ¶
type SourceType ¶
type SourceType uint
func (SourceType) MarshalJSON ¶
func (st SourceType) MarshalJSON() ([]byte, error)
func (SourceType) String ¶
func (st SourceType) String() string