Documentation
¶
Index ¶
Constants ¶
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CountSeed ¶
type CountSeed struct {
// contains filtered or unexported fields
}
A CountSeed allows the drill of seeds that keep an inner counter at time of writing only the basic prop++ counter is defined **Props type accepted: int
any other type is ignored
func NewCountSeed ¶
type NameIndex ¶
type NameIndex struct {
// contains filtered or unexported fields
}
Tuple for prop and field indexes, used by names map to get field or prop directly
type Seed ¶
type Seed interface {
// Get seed props
GetProps() []string
// Filter seed props, use in conjunction with GetProps to update them
WithProps([]string) int
// These methods returns seeds ready to drill
// Method to return a single seed
ReadOne() []prop
// Method to return an specified amount of seeds
ReadMany(int) []any
// Method to return all seeds, only 1 if no limit is configured
ReadAll() []any
// This method gets the size of the seed source, -1 if unlimited
GetSize() int
// This method gets the metadata of the seed, forces SeedMeta usage
GetMeta() *SeedMeta
}
The Seed interface allows the implementation of Seeds a Seed is the concept of a crop source, the seed must provide the availity to load data, keep internal state and refresh state. ... Each seed configures a inner struct of type Any, this struct is used to configure the data that is retrieved, since the struct fields are not known in advance, the seed must include logic to handle a proper usage of the struct
type SeedMeta ¶
type SeedMeta struct {
// Seed name
Name string
// Seed props
Props []prop
// Seed names
Names map[string]NameIndex
// Seed struct
Struct reflect.Value
}
Seeds metadata to perform operations on data and keep state of it
func ObtainProps ¶
An utility function to get the props of a struct of type any, allows seed implementations to follow the same guideline when setting up the initialization of the inner struct