Documentation ¶
Index ¶
- Constants
- Variables
- func CreateMapping(config configuration.Config, kind string) (result map[string]interface{}, err error)
- func GetErrCode(err error) (code int)
- func GetErrFromCode(code int, msg string) error
- type AggregationResult
- type AggregationsResult
- type AliasMapping
- type AliasName
- type AliasWrapper
- type CommandWithRights
- type CommandWrapper
- type ConditionConfig
- type Done
- type Entry
- func (entry *Entry) AddGroupRights(group string, rights string)
- func (entry *Entry) AddUserRights(user string, rights string)
- func (entry *Entry) RemoveGroupRights(group string)
- func (entry *Entry) RemoveUserRights(user string)
- func (entry *Entry) SetDefaultPermissions(config configuration.Config, kind string, owner string)
- func (this *Entry) SetResourceRights(rights ResourceRightsBase)
- func (entry Entry) ToResourceRights() (result ResourceRights)
- type EntryResult
- type EntryResultPermissionHolders
- type FeatureSelection
- type Hit
- type Hits
- type IndexName
- type ListAfter
- type ListOptions
- type ListOptionsMode
- type OpenSearchGetResult
- type PermCommandMsg
- type QueryCheckIds
- type QueryFind
- type QueryListCommons
- type QueryListIds
- type QueryMessage
- type QueryOperationType
- type ReindexIndexRef
- type ReindexRequest
- type ReindexResult
- type ResourceRights
- type ResourceRightsBase
- type ResourceVersion
- type Right
- type SearchResult
- type Selection
- type TermAggregationResultElement
- type TermsAggrT
- type Total
- type UpdateAliasAction
- type UpdateAliasIndexMapping
- type UpdateAliasRequest
- type UserCommandMsg
Constants ¶
View Source
const ListOptionsModeDefault = "Default"
View Source
const ListOptionsModeListIds = "ListIds"
View Source
const ListOptionsModeSelection = "Selection"
View Source
const ListOptionsModeTextSearch = "TextSearch"
View Source
const PermissionMapping = `` /* 514-byte string literal not displayed */
Variables ¶
View Source
var ErrAccessDenied = errors.New("access denied")
View Source
var ErrBadRequest = errors.New("bad request")
View Source
var ErrInvalidAuth = errors.New("invalid auth token")
View Source
var ErrNotFound = errors.New("not found")
Functions ¶
func CreateMapping ¶
func CreateMapping(config configuration.Config, kind string) (result map[string]interface{}, err error)
func GetErrCode ¶
func GetErrFromCode ¶
Types ¶
type AggregationResult ¶
type AggregationResult[HitT any, AggrT any] struct { SearchResult[HitT] Aggregations map[string]AggrT `json:"aggregations"` }
AggregationResult should be used if only one kind of aggregation is requested example: model.AggregationResult[Entry, TermsAggrT]{}
type AggregationsResult ¶
type AggregationsResult[HitT any, AggrT any] struct { SearchResult[HitT] Aggregations AggrT `json:"aggregations"` }
AggregationsResult should be used if multiple kinds of aggregations are requested example: model.AggregationsResult[Entry, struct{Foo TermsAggrT `json:"foo"`; Bar SometingElse `json:"bar"`}]{}
type AliasMapping ¶
type AliasMapping = map[AliasName]AliasWrapper
type AliasWrapper ¶
type AliasWrapper struct {
Aliases map[IndexName]interface{} `json:"aliases"`
}
type CommandWithRights ¶
type CommandWithRights struct { Command string `json:"command"` Id string `json:"id"` Rights *ResourceRightsBase `json:"rights"` }
type CommandWrapper ¶
type ConditionConfig ¶
type ConditionConfig struct { Feature string `json:"feature"` Operation QueryOperationType `json:"operation"` Value interface{} `json:"value"` Ref string `json:"ref"` }
type Entry ¶
type Entry struct { Resource string `json:"resource"` Features map[string]interface{} `json:"features"` Annotations map[string]interface{} `json:"annotations"` AdminUsers []string `json:"admin_users"` AdminGroups []string `json:"admin_groups"` ReadUsers []string `json:"read_users"` ReadGroups []string `json:"read_groups"` WriteUsers []string `json:"write_users"` WriteGroups []string `json:"write_groups"` ExecuteUsers []string `json:"execute_users"` ExecuteGroups []string `json:"execute_groups"` Creator string `json:"creator"` }
func (*Entry) AddGroupRights ¶
func (*Entry) AddUserRights ¶
func (*Entry) RemoveGroupRights ¶
func (*Entry) RemoveUserRights ¶
func (*Entry) SetDefaultPermissions ¶
func (entry *Entry) SetDefaultPermissions(config configuration.Config, kind string, owner string)
func (*Entry) SetResourceRights ¶
func (this *Entry) SetResourceRights(rights ResourceRightsBase)
func (Entry) ToResourceRights ¶
func (entry Entry) ToResourceRights() (result ResourceRights)
type EntryResult ¶
type EntryResult struct { Creator string `json:"creator"` Annotations map[string]interface{} `json:"annotations"` Permissions map[string]bool `json:"permissions"` PermissionHolders EntryResultPermissionHolders `json:"permission_holders"` }
EntryResult is ment to be used in combination with a resource model is intended to be used with client.Query() example:
type Device struct{ Id string `json:"id"` Name string `json:"name"` } type DeviceResult struct { EntryResult Device } func main() { client.Query[DeviceResult](c, token, model.QueryMessage{Resource:"devices"}) client.Query[Device](c, token, model.QueryMessage{Resource:"devices"}) }
type FeatureSelection ¶
type ListOptions ¶
type ListOptions struct { QueryListCommons ListIds []string TextSearch string Selection *FeatureSelection }
func (ListOptions) Mode ¶
func (this ListOptions) Mode() (mode ListOptionsMode, err error)
func (ListOptions) QueryValues ¶
func (this ListOptions) QueryValues() url.Values
func (ListOptions) Validate ¶
func (this ListOptions) Validate() error
type ListOptionsMode ¶
type ListOptionsMode = string
type OpenSearchGetResult ¶
type PermCommandMsg ¶
type QueryCheckIds ¶
type QueryFind ¶
type QueryFind struct { QueryListCommons Search string `json:"search"` Filter *Selection `json:"filter"` }
type QueryListCommons ¶
type QueryListCommons struct { Limit int `json:"limit"` Offset int `json:"offset"` // After may only be set if offset is 0 // this field must be used if offset + limit would exceed 10000 // when set the results begin after the referenced id and sort value // the sort value is used to efficiently locate the start point After *ListAfter `json:"after"` Rights string `json:"rights"` SortBy string `json:"sort_by"` SortDesc bool `json:"sort_desc"` // AddIdModifier is used to modify the resource id in the result // possible modifiers can be found and configured in the configuration.json under result_modifiers // example value: url.Values{"service_group_selection": {"a8ee3b1c-4cda-4f0d-9f55-4ef4882ce0af"}} AddIdModifier url.Values `json:"add_id_modifier,omitempty"` WithTotal bool `json:"with_total"` }
func GetQueryListCommonsFromUrlQuery ¶
func GetQueryListCommonsFromUrlQuery(queryParams url.Values) (result QueryListCommons, err error)
func (QueryListCommons) QueryValues ¶
func (this QueryListCommons) QueryValues() (result url.Values)
func (QueryListCommons) Validate ¶
func (this QueryListCommons) Validate() error
type QueryListIds ¶
type QueryListIds struct { QueryListCommons Ids []string `json:"ids"` }
type QueryMessage ¶
type QueryMessage struct { Resource string `json:"resource"` Find *QueryFind `json:"find"` ListIds *QueryListIds `json:"list_ids"` CheckIds *QueryCheckIds `json:"check_ids"` TermAggregate *string `json:"term_aggregate"` TermAggregateLimit int `json:"term_aggregate_limit"` }
type QueryOperationType ¶
type QueryOperationType string
const ( QueryEqualOperation QueryOperationType = "==" QueryUnequalOperation QueryOperationType = "!=" QueryAnyValueInFeatureOperation QueryOperationType = "any_value_in_feature" )
type ReindexIndexRef ¶
type ReindexIndexRef struct {
Index string `json:"index"`
}
type ReindexRequest ¶
type ReindexRequest struct { Source ReindexIndexRef `json:"source"` Dest ReindexIndexRef `json:"dest"` }
type ReindexResult ¶
type ReindexResult struct { Took int `json:"took"` TimedOut bool `json:"timed_out"` Total int `json:"total"` Updated int `json:"updated"` Created int `json:"created"` Deleted int `json:"deleted"` Batches int `json:"batches"` VersionConflicts int `json:"version_conflicts"` Noops int `json:"noops"` Retries struct { Bulk int `json:"bulk"` Search int `json:"search"` } `json:"retries"` ThrottledMillis int `json:"throttled_millis"` RequestsPerSecond float64 `json:"requests_per_second"` ThrottledUntilMillis int `json:"throttled_until_millis"` Failures []interface{} `json:"failures"` }
type ResourceRights ¶
type ResourceRights struct { ResourceRightsBase ResourceId string `json:"resource_id"` Features map[string]interface{} `json:"features"` Creator string `json:"creator"` }
type ResourceRightsBase ¶
type ResourceVersion ¶
type SearchResult ¶
type Selection ¶
type Selection struct { And []Selection `json:"and"` Or []Selection `json:"or"` Not *Selection `json:"not"` Condition ConditionConfig `json:"condition"` }
type TermAggregationResultElement ¶
type TermAggregationResultElement struct { Term interface{} `json:"term"` Count int64 `json:"count"` }
type TermsAggrT ¶
type UpdateAliasAction ¶
type UpdateAliasAction struct { Remove *UpdateAliasIndexMapping `json:"remove,omitempty"` Add *UpdateAliasIndexMapping `json:"add,omitempty"` }
type UpdateAliasIndexMapping ¶
type UpdateAliasRequest ¶
type UpdateAliasRequest struct {
Actions []UpdateAliasAction `json:"actions"`
}
type UserCommandMsg ¶
Click to show internal directories.
Click to hide internal directories.