Documentation ¶
Index ¶
- type Action
- type Ancestor
- type Ancestors
- type Artifact
- type Derivation
- type Derivative
- type ExcludeFromHash
- type GraphEdge
- type Hashable
- type Key
- type Producer
- type RawArtifact
- func (r RawArtifact) CacheDirPath() (string, error)
- func (r RawArtifact) Cacheable() bool
- func (r RawArtifact) LocallyCached(_ context.Context) (bool, error)
- func (r RawArtifact) MkCacheDir() (string, error)
- func (r RawArtifact) Pull(ctx context.Context) error
- func (r RawArtifact) Push(ctx context.Context) error
- func (r RawArtifact) RemotelyCached(ctx context.Context) (bool, error)
- func (r RawArtifact) ShortHash() string
- func (r *RawArtifact) UseWorkspaceConfig(config workspace.Config)
- func (r RawArtifact) WriteState() error
- type RawTarget
- func (t *RawTarget) Checksum() (rootHash hash.Hash, err error)
- func (t RawTarget) Dir() string
- func (t RawTarget) Hashcode() interface{}
- func (t RawTarget) Key() string
- func (t RawTarget) KeyHash() string
- func (t RawTarget) RelativeDir() string
- func (t RawTarget) String() string
- func (t *RawTarget) Validate() error
- type Store
- type Target
- type Validatable
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Action ¶
Action is an interface is implemented by a struct that should use a RawTarget to configure its execution and produce an Artifact
type Ancestor ¶
type Ancestor struct { Key string `json:"key" hash:"ignore"` Hash string `json:"hash" hash:"ignore"` }
Ancestor represents the key and hash of a parent target
type Ancestors ¶
type Ancestors []Ancestor
Ancestors an slice of ancestors used to define dependencies
func (Ancestors) GormDBDataType ¶
GormDBDataType gorm db data type
func (Ancestors) GormDataType ¶
GormDataType gorm common data type
type Artifact ¶
type Artifact interface { Cacheable() bool RemotelyCached(ctx context.Context) (bool, error) LocallyCached(ctx context.Context) (bool, error) Push(ctx context.Context) error Pull(ctx context.Context) error MkCacheDir() (string, error) WriteState() error }
Artifact is an interface that defines the behavior of a resource that can be stored and fetched from a content addressable store
type Derivation ¶
type Derivative ¶
type Derivative struct { RawTarget RawTarget `json:"Target"` RawArtifact RawArtifact `json:"Artifact"` }
type ExcludeFromHash ¶
type ExcludeFromHash struct {
SourceFiles json_datatypes.StringSlice `json:"sourceFiles" mapstructure:"sourceFiles"`
}
func (ExcludeFromHash) GormDBDataType ¶
GormDBDataType gorm db data type
func (ExcludeFromHash) GormDataType ¶
func (m ExcludeFromHash) GormDataType() string
GormDataType gorm common data type
func (*ExcludeFromHash) Scan ¶
func (m *ExcludeFromHash) Scan(val interface{}) error
Scan scan value into Jsonb, implements sql.Scanner interface
type GraphEdge ¶
GraphEdge represents the src key and dst key between two targets in a graph
type Hashable ¶
Hashable is an interface implemented by structs that can produce a deterministic hash of their properties
type RawArtifact ¶
type RawArtifact struct { Key string `json:"key" mapstructure:"key"` Hash string `json:"hash" mapstructure:"hash"` Type string `json:"type" mapstructure:"type"` Attributes map[string]interface{} `json:"attributes" mapstructure:"attributes,remain"` DependsOn Ancestors `json:"dependsOn" mapstructure:"dependsOn" hash:"-"` RemoteCacheBaseURL string `json:"remote_cache_base_url" mapstructure:"remote_cache_base_url"` }
RawArtifact represents the core representation of any artifact
func (RawArtifact) CacheDirPath ¶
func (r RawArtifact) CacheDirPath() (string, error)
CacheDirPath returns the constructed name of the local filesystem path for local caching of an artifact
func (RawArtifact) Cacheable ¶
func (r RawArtifact) Cacheable() bool
Cacheable always returns true as the default behavior should be to cache something
func (RawArtifact) LocallyCached ¶
func (r RawArtifact) LocallyCached(_ context.Context) (bool, error)
LocallyCached checks for the presence of a local artifact.json file
func (RawArtifact) MkCacheDir ¶
func (r RawArtifact) MkCacheDir() (string, error)
MkCacheDir creates a location on disk for storing an artifact locally
func (RawArtifact) Pull ¶
func (r RawArtifact) Pull(ctx context.Context) error
Pull downloads an artifact from a remote blob store to an expected location on disk
func (RawArtifact) Push ¶
func (r RawArtifact) Push(ctx context.Context) error
Push uploads an artifact to a remote blob store
func (RawArtifact) RemotelyCached ¶
func (r RawArtifact) RemotelyCached(ctx context.Context) (bool, error)
RemotelyCached checks a remote blob store for the presence of an artifact
func (RawArtifact) ShortHash ¶
func (r RawArtifact) ShortHash() string
ShortHash returns a 7 character version of the has returns an empty string if the hash is empty
func (*RawArtifact) UseWorkspaceConfig ¶
func (r *RawArtifact) UseWorkspaceConfig(config workspace.Config)
UseWorkspaceConfig injects the blob storage base URL into the raw artifact struct
func (RawArtifact) WriteState ¶
func (r RawArtifact) WriteState() error
WriteState writes a json representation of the raw artifact to the local cache directory
type RawTarget ¶
type RawTarget struct { ID string `json:"id" mapstructure:"id" hash:"-"` Name string `json:"name" mapstructure:"name"` Type string `json:"type" mapstructure:"type"` File string `json:"file" mapstructure:"file" hash:"-"` Realm string `json:"realm" mapstructure:"realm" hash:"-"` Attributes json_datatypes.MapStringInterface `json:"attributes" mapstructure:"attributes,remain"` SourceFiles json_datatypes.StringSlice `json:"sourceFiles" mapstructure:"sourceFiles" hash:"-"` Labels json_datatypes.StringSlice `json:"labels" mapstructure:"labels" hash:"-"` DependsOn Ancestors `json:"dependsOn" mapstructure:"dependsOn" hash:"-"` ExcludeFromHash ExcludeFromHash `json:"excludeFromHash" mapstructure:"excludeFromHash" hash:"-"` IgnoreFileNotExistsError bool `json:"ignoreFileNotExistsError" mapstructure:"ignoreFileNotExistsError"` }
RawTarget an object that represents the input of an action The RawTarget houses attributes that are easily serializable and must be cast or embedded in to other types
func (*RawTarget) Checksum ¶
Checksum executes the hash calculation algorithm on the provided target
func (RawTarget) Hashcode ¶
func (t RawTarget) Hashcode() interface{}
Hashcode implementing the graph hashcode interface
func (RawTarget) RelativeDir ¶
RelativeDir return the directory for the target relative to the root
type Store ¶
type Store interface { GetTargets() ([]RawTarget, error) GetTargetByKey(key string) (RawTarget, error) AddTarget(target RawTarget) (RawArtifact, error) ConnectTargets(edge GraphEdge) error GetGraph() (*dag.AcyclicGraph, error) GetGraphEdges() ([]GraphEdge, error) Open(connection string) error Migrate() error }
Store ...
type Target ¶
type Target interface { Producer Validatable Key() string }
type Validatable ¶
type Validatable interface {
Validate() error
}
Validatable is an interface implemented by a struct who's fields may be validated