Documentation
¶
Index ¶
- Constants
- Variables
- func Register(t string, fn func(config any) (Connector, error))
- type ArtifactTypeMap
- type Connector
- type ContextTypeMap
- type ExecutionTypeMap
- type PropertyType
- type RepoSet
- type Spec
- type SpecType
- func (st *SpecType) AddBoolean(name string) *SpecType
- func (st *SpecType) AddDouble(name string) *SpecType
- func (st *SpecType) AddInt(name string) *SpecType
- func (st *SpecType) AddProto(name string) *SpecType
- func (st *SpecType) AddString(name string) *SpecType
- func (st *SpecType) AddStruct(name string) *SpecType
Constants ¶
View Source
const ( PropertyTypeUnknown = iota PropertyTypeInt PropertyTypeDouble PropertyTypeString PropertyTypeStruct PropertyTypeProto PropertyTypeBoolean )
Variables ¶
View Source
var ( ErrCreatingDatastore = errors.New("error creating datastore") ErrUnsupportedDatastore = errors.New("unsupported datastore type") )
Functions ¶
Types ¶
type ArtifactTypeMap ¶ added in v0.3.2
ArtifactTypeMap maps artifact type names to IDs
type ContextTypeMap ¶ added in v0.3.2
ContextTypeMap maps context type names to IDs
type ExecutionTypeMap ¶ added in v0.3.2
ExecutionTypeMap maps execution type names to IDs
type PropertyType ¶ added in v0.3.2
type PropertyType int32
PropertyType is the data type of a property's value.
type RepoSet ¶ added in v0.3.2
type RepoSet interface {
// TypeMap returns a map of type names to IDs
TypeMap() map[string]int32
// Repository returns a repository instance of the specified type.
Repository(t reflect.Type) (any, error)
}
RepoSet holds repository implementions.
type Spec ¶ added in v0.3.2
type Spec struct {
// Maps artifact type names to an initializer.
ArtifactTypes map[string]*SpecType
// Maps context type names to an initializer.
ContextTypes map[string]*SpecType
// Maps execution type names to an initializer.
ExecutionTypes map[string]*SpecType
// Any repo initialization functions that don't map to a type can be
// added here.
Others []any
}
Spec is the specification for the datastore. Each entry
func (*Spec) AddArtifact ¶ added in v0.3.2
AddArtifact adds an artifact type to the spec.
func (*Spec) AddContext ¶ added in v0.3.2
AddContext adds a context type to the spec.
func (*Spec) AddExecution ¶ added in v0.3.2
AddExecution adds an execution type to the spec.
type SpecType ¶ added in v0.3.2
type SpecType struct {
// InitFn is a pointer to an initialization function that returns the
// repository instance and an optional error.
//
// Data Store implementations must pass arguments to the initialization
// functions that are required by the repository (database handles,
// HTTP clients, etc.) and should also provide values for the following
// types:
//
// - int64: type id
// - ArtifactTypeMap: Map of all artifact names to type IDs
// - ContextTypeMap: Map of all context names to type IDs
// - ExecutionTypeMap: Map of all execution names to type IDs
InitFn any
// Defined (non-custom) properties of the type.
Properties map[string]PropertyType
}
SpecType is a single type in the spec.
func NewSpecType ¶ added in v0.3.2
NewSpecType creates a SpecType instance.
func (*SpecType) AddBoolean ¶ added in v0.3.2
AddBoolean adds a boolean property to the type spec.
Click to show internal directories.
Click to hide internal directories.