Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterActions ¶
func RegisterActions(name string, actions *ObjectActions)
RegisterActions is used for static REST methods such as get (factory) and list. Methods such as update and delete require an object.
func RegisterStatic ¶
RegisterStatic adds a static method to an object
Types ¶
type Object ¶
type Object struct { Action *ObjectActions // contains filtered or unexported fields }
func (*Object) Static ¶
func (o *Object) Static(name string) *StaticMethod
type ObjectActions ¶
type ObjectActions struct { Fetch *StaticMethod // Fetch action receives "id" and returns an instance (factory) List *StaticMethod // List action returns a list of object }
ObjectActions defines generic factories for usage in API calls
type StaticMethod ¶
type StaticMethod struct {
// contains filtered or unexported fields
}
func Static ¶
func Static(method any) *StaticMethod
Static returns a StaticMethod object for a func that accepts a context.Context and/or a struct object that is its arguments.
Click to show internal directories.
Click to hide internal directories.