Documentation
¶
Index ¶
Constants ¶
View Source
const ( UUID4Type FunctionDefaultType = "uuid4" RandomType = "random" KSUIDType = "ksuid" SequenceType = "sequence" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FunctionDefault ¶
type FunctionDefault interface { // Take any number of arguments from "kwargs" Init(args map[string]interface{}) error // Return a list of supported types SupportedTypes() []datamantype.DatamanType // NOTE: we allow this method to return an error because some services may require it // even though this is the case, all efforts should be made to avoid an error in the GetDefault // call-- as it will impact the data-path // Take the db/collection/field and the current record and return the value for the field // context is used to pass in timeouts etc. (since some functions will call remote services etc.) GetDefault( ctx context.Context, defaultType datamantype.DatamanType, ) (interface{}, error) }
type FunctionDefaultType ¶
type FunctionDefaultType string
func (FunctionDefaultType) Get ¶
func (s FunctionDefaultType) Get() FunctionDefault
type KSUID ¶
type KSUID struct{}
Implementations
func (*KSUID) GetDefault ¶
func (u *KSUID) GetDefault(ctx context.Context, defaultType datamantype.DatamanType, ) (interface{}, error)
func (*KSUID) SupportedTypes ¶
func (u *KSUID) SupportedTypes() []datamantype.DatamanType
type Random ¶
type Random struct{}
Implementations
func (*Random) GetDefault ¶
func (u *Random) GetDefault(ctx context.Context, defaultType datamantype.DatamanType, ) (interface{}, error)
func (*Random) SupportedTypes ¶
func (u *Random) SupportedTypes() []datamantype.DatamanType
type Sequence ¶
type Sequence struct {
// contains filtered or unexported fields
}
Implementations
func (*Sequence) GetDefault ¶
func (s *Sequence) GetDefault(ctx context.Context, defaultType datamantype.DatamanType) (interface{}, error)
func (*Sequence) SupportedTypes ¶
func (s *Sequence) SupportedTypes() []datamantype.DatamanType
type UUID4 ¶
type UUID4 struct{}
Implementations
func (*UUID4) GetDefault ¶
func (u *UUID4) GetDefault(ctx context.Context, defaultType datamantype.DatamanType, ) (interface{}, error)
func (*UUID4) SupportedTypes ¶
func (u *UUID4) SupportedTypes() []datamantype.DatamanType
Click to show internal directories.
Click to hide internal directories.