Documentation
¶
Index ¶
- func LockFilePath(dir string) string
- type AttachmentConfig
- type CacheEntry
- type ChangeOp
- type Clients
- type Config
- type ConfigurationChange
- func GetChanges(ctx context.Context, clients Clients, conf *Config, schemas []LoadedSchema) ([]ConfigurationChange, error)
- func GetMetaTypeChanges(ctx context.Context, clients Clients, conf *Config) ([]ConfigurationChange, error)
- func GetMetricsChanges(ctx context.Context, clients Clients, conf *Config) ([]ConfigurationChange, error)
- func GetSchemaChanges(ctx context.Context, clients Clients, conf *Config, loaded []LoadedSchema) ([]ConfigurationChange, error)
- func GetStatusChanges(ctx context.Context, clients Clients, conf *Config) ([]ConfigurationChange, error)
- func GetTypeConfigurationChanges(ctx context.Context, clients Clients, conf *Config) ([]ConfigurationChange, error)
- func GetWorkflowChanges(ctx context.Context, clients Clients, conf *Config) ([]ConfigurationChange, error)
- type DocWorkflowUpdate
- type DocumentConfig
- type DocumentWorkflow
- type GitSchemaSource
- type HttpSchemaSource
- type LabelExpression
- type LoadedSchema
- type MetricAggregation
- type MetricKind
- type MetricUpdate
- type SchemaCache
- type SchemaLock
- type SchemaLockfile
- type SchemaSet
- type SchemaSource
- type StaticClients
- type TimeExpression
- type TypeConfigSpec
- type TypeConfigurationChange
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LockFilePath ¶
Types ¶
type AttachmentConfig ¶
type CacheEntry ¶
type Clients ¶
type Clients interface {
GetWorkflows() repository.Workflows
GetSchemas() repository.Schemas
GetMetrics() repository.Metrics
}
type Config ¶
type Config struct {
Documents []DocumentConfig `hcl:"document,block"`
SchemaSets []SchemaSet `hcl:"schema_set,block"`
Metric []MetricKind `hcl:"metric,block"`
}
func ReadConfigFromDirectory ¶
type ConfigurationChange ¶
type ConfigurationChange interface {
Describe() (ChangeOp, string)
Execute(ctx context.Context, c Clients) error
}
func GetChanges ¶
func GetChanges( ctx context.Context, clients Clients, conf *Config, schemas []LoadedSchema, ) ([]ConfigurationChange, error)
func GetMetaTypeChanges ¶
func GetMetricsChanges ¶
func GetSchemaChanges ¶
func GetSchemaChanges( ctx context.Context, clients Clients, conf *Config, loaded []LoadedSchema, ) ([]ConfigurationChange, error)
func GetStatusChanges ¶
func GetWorkflowChanges ¶
type DocWorkflowUpdate ¶
type DocWorkflowUpdate struct {
Operation ChangeOp
Type string
Current *DocumentWorkflow
Wanted *DocumentWorkflow
// contains filtered or unexported fields
}
func (*DocWorkflowUpdate) Describe ¶
func (d *DocWorkflowUpdate) Describe() (ChangeOp, string)
Describe implements ConfigurationChange.
type DocumentConfig ¶
type DocumentConfig struct {
Type string `hcl:"type,label"`
MetaDocType string `hcl:"meta_doc,optional"`
Statuses []string `hcl:"statuses,optional"`
Workflow *DocumentWorkflow `hcl:"workflow,optional"`
Attachments []AttachmentConfig `hcl:"attachment,block"`
BoundedCollection bool `hcl:"bounded_collection,optional"`
TimeExpressions []TimeExpression `hcl:"time_expression,block"`
LabelExpressions []LabelExpression `hcl:"label_expression,block"`
}
type DocumentWorkflow ¶
type GitSchemaSource ¶
type GitSchemaSource struct {
// contains filtered or unexported fields
}
func NewGitSchemaSource ¶
func (*GitSchemaSource) LoadSchema ¶
func (g *GitSchemaSource) LoadSchema(ctx context.Context, name string) (LoadedSchema, error)
LoadSchema implements SchemaSource.
type HttpSchemaSource ¶
type HttpSchemaSource struct {
// contains filtered or unexported fields
}
func NewHttpSchemaSource ¶
func (*HttpSchemaSource) LoadSchema ¶
func (h *HttpSchemaSource) LoadSchema( ctx context.Context, name string, ) (_ LoadedSchema, outErr error)
LoadSchema implements SchemaSource.
type LabelExpression ¶
type LoadedSchema ¶
type LoadedSchema struct {
Lock SchemaLock
Data []byte
}
func LoadSchemaSet ¶
func LoadSchemaSet( ctx context.Context, set SchemaSet, lockfile *SchemaLockfile, init bool, ) (_ []LoadedSchema, outErr error)
type MetricAggregation ¶
type MetricAggregation string
const ( MetricAggregationReplace MetricAggregation = "replace" MetricAggregationIncrement MetricAggregation = "increment" )
type MetricKind ¶
type MetricKind struct {
Kind string `hcl:"kind,label"`
Aggregation MetricAggregation `hcl:"aggregation,optional"`
}
type MetricUpdate ¶
type MetricUpdate struct {
Operation ChangeOp
Kind string
OldAggregation MetricAggregation
Aggregation MetricAggregation
}
func (*MetricUpdate) Describe ¶
func (m *MetricUpdate) Describe() (ChangeOp, string)
Describe implements ConfigurationChange.
type SchemaCache ¶
type SchemaCache struct {
// contains filtered or unexported fields
}
func NewSchemaCache ¶
func NewSchemaCache() (*SchemaCache, error)
type SchemaLock ¶
type SchemaLockfile ¶
type SchemaLockfile struct {
Updated time.Time `json:"updated"`
Schemas map[string]SchemaLock `json:"schemas"`
}
func LoadLockFile ¶
func LoadLockFile(fileName string) (*SchemaLockfile, error)
func NewSchemaLockFile ¶
func NewSchemaLockFile(loaded []LoadedSchema) *SchemaLockfile
func (*SchemaLockfile) Check ¶
func (lf *SchemaLockfile) Check( name string, loaded LoadedSchema, init bool, ) error
func (*SchemaLockfile) Save ¶
func (lf *SchemaLockfile) Save(fileName string) error
type SchemaSource ¶
type SchemaSource interface {
LoadSchema(ctx context.Context, name string) (LoadedSchema, error)
}
type StaticClients ¶
type StaticClients struct {
Workflows repository.Workflows
Schemas repository.Schemas
Metrics repository.Metrics
}
func (*StaticClients) GetMetrics ¶
func (c *StaticClients) GetMetrics() repository.Metrics
GetMetrics implements Clients.
func (*StaticClients) GetSchemas ¶
func (c *StaticClients) GetSchemas() repository.Schemas
GetSchemas implements Clients.
func (*StaticClients) GetWorkflows ¶
func (c *StaticClients) GetWorkflows() repository.Workflows
GetWorkflows implements Clients.
type TimeExpression ¶
type TimeExpression struct {
// Expression is a newsdoc value extraction expression.
Expression string `hcl:"expression"`
// Layout is the time/date format to use when parsing. Optional,
// defaults to RFC3339 or ISO 8601 for values annotated as dates.
Layout string `hcl:"layout,optional"`
// Timezone is the timezone the time should be parsed in. Optional, most
// timestamps should include timezone information, if they don't,
// parsing will fall back to the default timezone that the repository
// has been configured with.
Timezone string `hcl:"timezone,optional"`
}
type TypeConfigSpec ¶
type TypeConfigSpec struct {
Bounded bool
TimeExpressions []TimeExpression
LabelExpressions []LabelExpression
}
type TypeConfigurationChange ¶
type TypeConfigurationChange struct {
Operation ChangeOp
Type string
Current TypeConfigSpec
Wanted TypeConfigSpec
// contains filtered or unexported fields
}
func (*TypeConfigurationChange) Describe ¶
func (t *TypeConfigurationChange) Describe() (ChangeOp, string)
Describe implements ConfigurationChange.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.