Documentation ¶
Index ¶
- Constants
- Variables
- func Id(sv reflect.Value) (string, gomerr.Gomerr)
- func NewIdTool(dp structs.DirectiveProvider) *structs.Tool
- func Register(instance Instance, collection Collection, ...) (md *metadata, ge gomerr.Gomerr)
- func RegisterIdGeneratorFieldFunction(idGenerator id.Generator)
- func SaveInstance(i Instance) gomerr.Gomerr
- type Action
- type BaseCollection
- type BaseInstance
- func (i BaseInstance) Id() string
- func (i BaseInstance) NewQueryable() data.Queryable
- func (BaseInstance) PostCreate() gomerr.Gomerr
- func (BaseInstance) PostDelete() gomerr.Gomerr
- func (BaseInstance) PostRead() gomerr.Gomerr
- func (BaseInstance) PostUpdate(Resource) gomerr.Gomerr
- func (BaseInstance) PreCreate() gomerr.Gomerr
- func (BaseInstance) PreDelete() gomerr.Gomerr
- func (BaseInstance) PreRead() gomerr.Gomerr
- func (BaseInstance) PreUpdate(Resource) gomerr.Gomerr
- func (i BaseInstance) TypeName() string
- type BaseResource
- type Category
- type Collectible
- type Collection
- type Creatable
- type Deletable
- type Instance
- type Listable
- type Metadata
- type NoOpAction
- func (NoOpAction) Do(Resource) gomerr.Gomerr
- func (NoOpAction) FieldAccessPermissions() auth.AccessPermissions
- func (NoOpAction) Name() string
- func (NoOpAction) OnDoFailure(_ Resource, ge gomerr.Gomerr) gomerr.Gomerr
- func (NoOpAction) OnDoSuccess(r Resource) (Resource, gomerr.Gomerr)
- func (NoOpAction) Pre(Resource) gomerr.Gomerr
- type OnCreateFailer
- type OnDeleteFailer
- type OnListFailer
- type OnReadFailer
- type OnUpdateFailer
- type Readable
- type Resource
- type Updatable
Constants ¶
View Source
const SourceValue = "$_source_value"
Variables ¶
View Source
var DefaultIdFieldTool = NewIdTool(structs.StructTagDirectiveProvider{"id"})
View Source
var IdTool = NewIdTool(structs.StructTagDirectiveProvider{"id"})
IdTool contains the configured tool to copy ids. It's initialized to id.DefaultIdFieldTool, but can be replaced if preferred.
Functions ¶
func NewIdTool ¶
func NewIdTool(dp structs.DirectiveProvider) *structs.Tool
NewIdTool produces a structs.Applier that will take each of the defined id fields and propagate them to another struct value. Todo:p3 specify that should be ordered in decreasing specificity.
func SaveInstance ¶
Types ¶
type Action ¶
type Action interface { Name() string AppliesToCategory() Category FieldAccessPermissions() auth.AccessPermissions Pre(Resource) gomerr.Gomerr Do(Resource) gomerr.Gomerr OnDoSuccess(Resource) (Resource, gomerr.Gomerr) OnDoFailure(Resource, gomerr.Gomerr) gomerr.Gomerr }
func CreateAction ¶
func CreateAction() Action
func DeleteAction ¶
func DeleteAction() Action
func ListAction ¶
func ListAction() Action
func ReadAction ¶
func ReadAction() Action
func UpdateAction ¶
func UpdateAction() Action
type BaseCollection ¶
type BaseCollection struct {
BaseResource
}
func (BaseCollection) MaximumPageSize ¶
func (BaseCollection) MaximumPageSize() int
func (BaseCollection) PostList ¶
func (BaseCollection) PostList() gomerr.Gomerr
func (BaseCollection) PreList ¶
func (BaseCollection) PreList() gomerr.Gomerr
func (BaseCollection) TypeNames ¶
func (c BaseCollection) TypeNames() []string
func (BaseCollection) TypeOf ¶
func (c BaseCollection) TypeOf(interface{}) string
type BaseInstance ¶
type BaseInstance struct {
BaseResource
}
func (BaseInstance) Id ¶
func (i BaseInstance) Id() string
func (BaseInstance) NewQueryable ¶
func (i BaseInstance) NewQueryable() data.Queryable
func (BaseInstance) PostCreate ¶
func (BaseInstance) PostCreate() gomerr.Gomerr
func (BaseInstance) PostDelete ¶
func (BaseInstance) PostDelete() gomerr.Gomerr
func (BaseInstance) PostRead ¶
func (BaseInstance) PostRead() gomerr.Gomerr
func (BaseInstance) PostUpdate ¶
func (BaseInstance) PostUpdate(Resource) gomerr.Gomerr
func (BaseInstance) PreCreate ¶
func (BaseInstance) PreCreate() gomerr.Gomerr
func (BaseInstance) PreDelete ¶
func (BaseInstance) PreDelete() gomerr.Gomerr
func (BaseInstance) PreRead ¶
func (BaseInstance) PreRead() gomerr.Gomerr
func (BaseInstance) TypeName ¶
func (i BaseInstance) TypeName() string
type BaseResource ¶
type BaseResource struct {
// contains filtered or unexported fields
}
func (*BaseResource) DoAction ¶
func (b *BaseResource) DoAction(action Action) (Resource, gomerr.Gomerr)
func (*BaseResource) Metadata ¶
func (b *BaseResource) Metadata() Metadata
func (*BaseResource) Subject ¶
func (b *BaseResource) Subject() auth.Subject
type Collectible ¶
type Collection ¶
type Listable ¶
type Listable interface { Collection PreList() gomerr.Gomerr PostList() gomerr.Gomerr }
type NoOpAction ¶
type NoOpAction struct{}
func (NoOpAction) FieldAccessPermissions ¶
func (NoOpAction) FieldAccessPermissions() auth.AccessPermissions
func (NoOpAction) Name ¶
func (NoOpAction) Name() string
func (NoOpAction) OnDoFailure ¶
func (NoOpAction) OnDoSuccess ¶
func (NoOpAction) OnDoSuccess(r Resource) (Resource, gomerr.Gomerr)
type OnCreateFailer ¶
type OnDeleteFailer ¶
type OnUpdateFailer ¶
Click to show internal directories.
Click to hide internal directories.