Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( StructTag = "ns" StructTagConnectionName = "connectionName" StructTagConnectionType = "connectionType" StructTagConnectionContract = "connectionContract" StructTagOptional = "optional" )
Functions ¶
func CheckValidField ¶
Types ¶
type ErrInvalidContractField ¶
type ErrInvalidContractField struct { ObjectType reflect.Type FieldType reflect.Type Message string }
func (ErrInvalidContractField) Error ¶
func (e ErrInvalidContractField) Error() string
type ErrMissingRequiredConnection ¶
type ErrMissingRequiredConnection struct { ConnectionName string ConnectionType string ConnectionContract string }
func (ErrMissingRequiredConnection) Error ¶
func (e ErrMissingRequiredConnection) Error() string
type ErrMissingRequiredOutput ¶
type ErrMissingRequiredOutput struct {
Name string
}
func (ErrMissingRequiredOutput) Error ¶
func (e ErrMissingRequiredOutput) Error() string
type Field ¶
type Field struct { Field reflect.StructField Tag string Name string ConnectionType string ConnectionName string ConnectionContract string Optional bool }
Field is a representation of a struct tag that is specific to nullstone outputs You can define an output mapping directly to a workspace or to outputs through a connection in that workspace
Examples:
type Outputs struct { Output1 string `ns:"output1"` OptionalOutput string `ns:"optional_output,optional"` MapOutput map[string]string `ns:"map_output"` Dependency DependencyOutputs `ns:",connectionType:some-dependency"` }
type DependencyOutputs struct { Output2 string `ns:"output2"` }
Notes:
All fields that that map connections must be a well-defined struct If you want to ignore a member in the struct, use `ns:"-"` If you want to make a field/connection optional, add `ns:"output,optional"`
func (Field) InitializeConnectionValue ¶
func (f Field) InitializeConnectionValue(obj interface{}) interface{}
type Retriever ¶
type Retriever struct {
NsConfig api.Config
}
func (*Retriever) GetConnectionWorkspace ¶
func (r *Retriever) GetConnectionWorkspace(source *types.Workspace, connectionName, connectionType, connectionContract string) (*types.Workspace, error)
GetConnectionWorkspace gets the workspace from nullstone through a connection from the source workspace This will search through connections matching on connectionName and connectionType Specify "" to ignore filtering for that field One of either connectionName or connectionType must be specified
func (*Retriever) Retrieve ¶
Retrieve is capable of retrieving all outputs for a given workspace To properly use, the input obj must be a pointer to a struct that contains fields that map to outputs Struct tags on each field within the struct define how to read the outputs from nullstone APIs See Field for more details