Documentation
¶
Index ¶
- Constants
- func Init(props *InitProps)
- func SeedStructful(files []string) error
- type AdaptorType
- type IAdaptor
- type IStructful
- type InitProps
- type MongoAdaptor
- func (a *MongoAdaptor) CheckHash(hash string) bool
- func (a *MongoAdaptor) GetDb() string
- func (a *MongoAdaptor) GetName() string
- func (a *MongoAdaptor) GetWithFilter(filter map[string]any) ([]map[string]any, error)
- func (a *MongoAdaptor) List() ([]map[string]any, error)
- func (a *MongoAdaptor) Save(data map[string]any) error
- type Structful
- func (s *Structful) CheckHash(hash string) bool
- func (s *Structful) FilterByGroup(group string, filter map[string]any) ([]map[string]any, error)
- func (s *Structful) GetByGroup(group string) ([]map[string]any, error)
- func (s *Structful) GetOne(group, name string) (map[string]any, error)
- func (s *Structful) List() ([]map[string]any, error)
- func (s *Structful) Save(data map[string]any) error
- type StructfulProps
Constants ¶
View Source
const (
AdaptorType_Mongo = iota
)
Variables ¶
This section is empty.
Functions ¶
func SeedStructful ¶
Types ¶
type AdaptorType ¶
type AdaptorType int
type IAdaptor ¶
type IAdaptor interface {
Save(data map[string]any) error
GetWithFilter(filter map[string]any) ([]map[string]any, error)
// GetSysDb returns the name of the database to use.
GetDb() string
// GetName the collection to store structful data.
GetName() string
CheckHash(string) bool
List() ([]map[string]any, error)
}
type IStructful ¶
type IStructful interface {
Within(version string) *Structful
Save(data map[string]any) error
GetByGroup(group string) []map[string]any
FilterByGroup(group string, filter map[string]any) []map[string]any
GetOne(group, name string) map[string]any
CheckHash(string) bool
List() ([]map[string]any, error)
}
type MongoAdaptor ¶
type MongoAdaptor struct {
IAdaptor
// contains filtered or unexported fields
}
func CreateMongoAdaptor ¶
func CreateMongoAdaptor(sysDb string, name string) *MongoAdaptor
func (*MongoAdaptor) CheckHash ¶
func (a *MongoAdaptor) CheckHash(hash string) bool
func (*MongoAdaptor) GetDb ¶
func (a *MongoAdaptor) GetDb() string
func (*MongoAdaptor) GetName ¶
func (a *MongoAdaptor) GetName() string
func (*MongoAdaptor) GetWithFilter ¶
type Structful ¶
type Structful struct {
IStructful
SysDb string
Name string
Version string
Adaptor IAdaptor
}
func CreateStructful ¶
func CreateStructful(props *StructfulProps) *Structful
func GetStructful ¶
func GetStructful(props *StructfulProps) *Structful
func (*Structful) FilterByGroup ¶
func (*Structful) GetByGroup ¶
type StructfulProps ¶
type StructfulProps struct {
Adaptor AdaptorType
SysDb string
Name string
Version string
}
Click to show internal directories.
Click to hide internal directories.