Documentation
¶
Overview ¶
API Actor api for managing locations
Index ¶
- type ItemLocation
- type ListLocations
- func (ll ListLocations) FilterByGID(gid uint64) ListLocations
- func (ll ListLocations) FilterByID(id uint64) ListLocations
- func (ll ListLocations) FilterByName(name string) ListLocations
- func (ll ListLocations) FilterFunc(predicate func(ItemLocation) bool) ListLocations
- func (ll ListLocations) FindOne() ItemLocation
- func (ll ListLocations) IDs() []uint64
- func (ll ListLocations) Serialize(params ...string) (serialization.Serialized, error)
- type ListRequest
- type Locations
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ItemLocation ¶
type ItemLocation struct { // AuthBroker AuthBroker []string `json:"authBroker"` // Grid ID GID uint64 `json:"gid"` // ID ID uint64 `json:"id"` // GUID GUID uint64 `json:"guid"` // Location code LocationCode string `json:"locationCode"` // Name Name string `json:"name"` // Flag Flag string `json:"flag"` // Meta Meta []interface{} `json:"_meta"` // CKey CKey string `json:"_ckey"` }
Main information about locations
func (ItemLocation) Serialize ¶
func (il ItemLocation) Serialize(params ...string) (serialization.Serialized, error)
Serialize returns JSON-serialized []byte. Used as a wrapper over json.Marshal and json.MarshalIndent functions.
In order to serialize with indent make sure to follow these guidelines:
- First argument -> prefix
- Second argument -> indent
type ListLocations ¶
type ListLocations struct { // Data Data []ItemLocation `json:"data"` // Entry count EntryCount uint64 `json:"entryCount"` }
List of locations
func (ListLocations) FilterByGID ¶ added in v1.3.1
func (ll ListLocations) FilterByGID(gid uint64) ListLocations
FilterByGID returns ListLocations with specified GID.
func (ListLocations) FilterByID ¶
func (ll ListLocations) FilterByID(id uint64) ListLocations
FilterByID returns ListLocations with specified ID.
func (ListLocations) FilterByName ¶
func (ll ListLocations) FilterByName(name string) ListLocations
FilterByName returns ListLocations with specified Name.
func (ListLocations) FilterFunc ¶
func (ll ListLocations) FilterFunc(predicate func(ItemLocation) bool) ListLocations
FilterFunc allows filtering ListLocations based on a user-specified predicate.
func (ListLocations) FindOne ¶
func (ll ListLocations) FindOne() ItemLocation
FindOne returns first found ItemLocation If none was found, returns an empty struct.
func (ListLocations) IDs ¶ added in v1.6.8
func (ll ListLocations) IDs() []uint64
IDs gets array of LocationIDs from ListLocations struct
func (ListLocations) Serialize ¶
func (ll ListLocations) Serialize(params ...string) (serialization.Serialized, error)
Serialize returns JSON-serialized []byte. Used as a wrapper over json.Marshal and json.MarshalIndent functions.
In order to serialize with indent make sure to follow these guidelines:
- First argument -> prefix
- Second argument -> indent
type ListRequest ¶
type ListRequest struct { // Page number // Required: false Page uint64 `url:"page,omitempty" json:"page,omitempty"` // Page size // Required: false Size uint64 `url:"size,omitempty" json:"size,omitempty"` // Find by flag // Required: false Flag string `url:"flag,omitempty" json:"flag,omitempty"` // Find by name // Required: false Name string `url:"name,omitempty" json:"name,omitempty"` // Find by ID // Required: false ByID uint64 `url:"by_id,omitempty" json:"by_id,omitempty"` // Find by code location // Required: false LocationCode string `url:"locationCode,omitempty" json:"locationCode,omitempty"` }
ListRequest struct to get list of locations
type Locations ¶
type Locations struct {
// contains filtered or unexported fields
}
Structure for creating request to locations
func (Locations) List ¶
func (l Locations) List(ctx context.Context, req ListRequest) (*ListLocations, error)
List gets list of all locations as a ListLocations struct