Documentation ¶
Index ¶
- Constants
- Variables
- func MakeFileParameterStore(config map[string]interface{}, definitions *kodex.Definitions) (kodex.ParameterStore, error)
- func MakeInMemoryParameterStore(config map[string]interface{}, definitions *kodex.Definitions) (kodex.ParameterStore, error)
- type ByPosition
- type DataChunk
- type DataEntry
- type DataStore
- type FileDataStore
- type FileParameterStore
- func (p *FileParameterStore) AllParameterSets() ([]*kodex.ParameterSet, error)
- func (p *FileParameterStore) AllParameters() ([]*kodex.Parameters, error)
- func (p *FileParameterStore) Definitions() *kodex.Definitions
- func (p *FileParameterStore) ParameterSet(hash []byte) (*kodex.ParameterSet, error)
- func (p *FileParameterStore) Parameters(action kodex.Action, parameterGroup *kodex.ParameterGroup) (*kodex.Parameters, error)
- func (p *FileParameterStore) ParametersById(id []byte) (*kodex.Parameters, error)
- func (p *FileParameterStore) SaveParameterSet(parameterSet *kodex.ParameterSet) (bool, error)
- func (p *FileParameterStore) SaveParameters(parameters *kodex.Parameters) (bool, error)
- type InMemoryParameterStore
- func (p *InMemoryParameterStore) AllParameterSets() ([]*kodex.ParameterSet, error)
- func (p *InMemoryParameterStore) AllParameters() ([]*kodex.Parameters, error)
- func (p *InMemoryParameterStore) Definitions() *kodex.Definitions
- func (p *InMemoryParameterStore) DeleteParameterSet(parameterSet *kodex.ParameterSet) error
- func (p *InMemoryParameterStore) DeleteParameters(parameters *kodex.Parameters) error
- func (p *InMemoryParameterStore) ParameterSet(hash []byte) (*kodex.ParameterSet, error)
- func (p *InMemoryParameterStore) Parameters(action kodex.Action, parameterGroup *kodex.ParameterGroup) (*kodex.Parameters, error)
- func (p *InMemoryParameterStore) ParametersById(id []byte) (*kodex.Parameters, error)
- func (p *InMemoryParameterStore) RestoreParameterSet(data map[string]interface{}) (*kodex.ParameterSet, error)
- func (p *InMemoryParameterStore) RestoreParameters(data map[string]interface{}) (*kodex.Parameters, error)
- func (p *InMemoryParameterStore) SaveParameterSet(parameterSet *kodex.ParameterSet) (bool, error)
- func (p *InMemoryParameterStore) SaveParameters(parameters *kodex.Parameters) (bool, error)
- type IsFilename
Constants ¶
View Source
const ( NullType = iota ParametersType ParameterSetType )
View Source
const BUFFER_SIZE = 63
View Source
const CHUNK_HEADER_SIZE = 8 + CHUNK_ID_LENGTH
View Source
const CHUNK_ID_LENGTH = kodex.RANDOM_ID_LENGTH
View Source
const CHUNK_VERSION = 1
View Source
const ENTRY_VERSION = 1
Variables ¶
View Source
var FileParameterStoreForm = forms.Form{ Fields: []forms.Field{ forms.Field{ Name: "filename", Validators: []forms.Validator{ forms.IsRequired{}, forms.IsString{}, IsFilename{}, }, }, forms.Field{ Name: "format", Validators: []forms.Validator{ forms.IsOptional{Default: "json"}, forms.IsIn{Choices: []interface{}{"json"}}, }, }, forms.Field{ Name: "in-memory-config", Validators: []forms.Validator{ forms.IsOptional{ Default: map[string]interface{}{}, }, forms.IsStringMap{}, }, }, }, }
View Source
var ParameterStores = kodex.ParameterStoreDefinitions{ "file": kodex.ParameterStoreDefinition{ Maker: MakeFileParameterStore, }, "inMemory": kodex.ParameterStoreDefinition{ Maker: MakeInMemoryParameterStore, }, }
Functions ¶
func MakeFileParameterStore ¶
func MakeFileParameterStore(config map[string]interface{}, definitions *kodex.Definitions) (kodex.ParameterStore, error)
func MakeInMemoryParameterStore ¶
func MakeInMemoryParameterStore(config map[string]interface{}, definitions *kodex.Definitions) (kodex.ParameterStore, error)
Types ¶
type ByPosition ¶
func (ByPosition) Len ¶
func (b ByPosition) Len() int
func (ByPosition) Less ¶
func (b ByPosition) Less(i, j int) bool
func (ByPosition) Swap ¶
func (b ByPosition) Swap(i, j int)
type DataChunk ¶
type DataEntry ¶
func (*DataEntry) Reassemble ¶
type FileDataStore ¶
type FileDataStore struct {
// contains filtered or unexported fields
}
A file-based data store
func MakeFileDataStore ¶
func MakeFileDataStore(filename, format string) *FileDataStore
func (*FileDataStore) Init ¶
func (f *FileDataStore) Init() error
func (*FileDataStore) Read ¶
func (f *FileDataStore) Read() ([]*DataEntry, error)
func (*FileDataStore) Write ¶
func (f *FileDataStore) Write(entry *DataEntry) error
type FileParameterStore ¶
type FileParameterStore struct {
// contains filtered or unexported fields
}
The file parameter store uses an append-only file that it writes parameters to. This enables parallel writin to the store without locking. To ensure consistency of the written parameters, we implement a reconciliation method in our store.
Each
func (*FileParameterStore) AllParameterSets ¶
func (p *FileParameterStore) AllParameterSets() ([]*kodex.ParameterSet, error)
func (*FileParameterStore) AllParameters ¶
func (p *FileParameterStore) AllParameters() ([]*kodex.Parameters, error)
func (*FileParameterStore) Definitions ¶
func (p *FileParameterStore) Definitions() *kodex.Definitions
func (*FileParameterStore) ParameterSet ¶
func (p *FileParameterStore) ParameterSet(hash []byte) (*kodex.ParameterSet, error)
func (*FileParameterStore) Parameters ¶
func (p *FileParameterStore) Parameters(action kodex.Action, parameterGroup *kodex.ParameterGroup) (*kodex.Parameters, error)
func (*FileParameterStore) ParametersById ¶
func (p *FileParameterStore) ParametersById(id []byte) (*kodex.Parameters, error)
func (*FileParameterStore) SaveParameterSet ¶
func (p *FileParameterStore) SaveParameterSet(parameterSet *kodex.ParameterSet) (bool, error)
func (*FileParameterStore) SaveParameters ¶
func (p *FileParameterStore) SaveParameters(parameters *kodex.Parameters) (bool, error)
type InMemoryParameterStore ¶
type InMemoryParameterStore struct {
// contains filtered or unexported fields
}
func (*InMemoryParameterStore) AllParameterSets ¶
func (p *InMemoryParameterStore) AllParameterSets() ([]*kodex.ParameterSet, error)
func (*InMemoryParameterStore) AllParameters ¶
func (p *InMemoryParameterStore) AllParameters() ([]*kodex.Parameters, error)
func (*InMemoryParameterStore) Definitions ¶
func (p *InMemoryParameterStore) Definitions() *kodex.Definitions
func (*InMemoryParameterStore) DeleteParameterSet ¶
func (p *InMemoryParameterStore) DeleteParameterSet(parameterSet *kodex.ParameterSet) error
func (*InMemoryParameterStore) DeleteParameters ¶
func (p *InMemoryParameterStore) DeleteParameters(parameters *kodex.Parameters) error
func (*InMemoryParameterStore) ParameterSet ¶
func (p *InMemoryParameterStore) ParameterSet(hash []byte) (*kodex.ParameterSet, error)
func (*InMemoryParameterStore) Parameters ¶
func (p *InMemoryParameterStore) Parameters(action kodex.Action, parameterGroup *kodex.ParameterGroup) (*kodex.Parameters, error)
func (*InMemoryParameterStore) ParametersById ¶
func (p *InMemoryParameterStore) ParametersById(id []byte) (*kodex.Parameters, error)
func (*InMemoryParameterStore) RestoreParameterSet ¶
func (p *InMemoryParameterStore) RestoreParameterSet(data map[string]interface{}) (*kodex.ParameterSet, error)
func (*InMemoryParameterStore) RestoreParameters ¶
func (p *InMemoryParameterStore) RestoreParameters(data map[string]interface{}) (*kodex.Parameters, error)
func (*InMemoryParameterStore) SaveParameterSet ¶
func (p *InMemoryParameterStore) SaveParameterSet(parameterSet *kodex.ParameterSet) (bool, error)
func (*InMemoryParameterStore) SaveParameters ¶
func (p *InMemoryParameterStore) SaveParameters(parameters *kodex.Parameters) (bool, error)
type IsFilename ¶
type IsFilename struct{}
func (IsFilename) Validate ¶
func (f IsFilename) Validate(value interface{}, values map[string]interface{}) (interface{}, error)
Click to show internal directories.
Click to hide internal directories.