client

package
v0.0.13 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 27, 2024 License: Apache-2.0 Imports: 9 Imported by: 13

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrAccessDenied = model.ErrAccessDenied
View Source
var ErrBadRequest = model.ErrBadRequest
View Source
var ErrInvalidAuth = model.ErrInvalidAuth
View Source
var ErrNotFound = model.ErrNotFound

Functions

func JsonCast

func JsonCast[Result any](in interface{}) (result Result, err error)

func List

func List[Result any](client Client, token string, kind string, options model.ListOptions) (result Result, err error)

func Query

func Query[Result any](client Client, token string, query model.QueryMessage) (result Result, code int, err error)

Types

type Client

type Client interface {
	Query(token string, query QueryMessage) (result interface{}, code int, err error)
	List(token string, kind string, options ListOptions) (result []map[string]interface{}, err error)
	Total(token string, kind string, options ListOptions) (result int64, err error)

	CheckUserOrGroup(token string, kind string, resource string, rights string) (err error)
	GetRights(token string, kind string, resource string) (result model.ResourceRights, err error)

	GetTermAggregation(token string, kind string, rights string, field string, limit int) (result []model.TermAggregationResultElement, err error)
}

func NewClient

func NewClient(baseUrl string) Client

type ConditionConfig

type ConditionConfig = model.ConditionConfig

type FeatureSelection

type FeatureSelection = model.FeatureSelection

type ListAfter

type ListAfter = model.ListAfter

type ListOptions

type ListOptions = model.ListOptions

type QueryCheckIds

type QueryCheckIds = model.QueryCheckIds

type QueryFind

type QueryFind = model.QueryFind

type QueryListCommons

type QueryListCommons = model.QueryListCommons

type QueryListIds

type QueryListIds = model.QueryListIds

type QueryMessage

type QueryMessage = model.QueryMessage

type QueryOperationType

type QueryOperationType = model.QueryOperationType
const (
	QueryEqualOperation             QueryOperationType = model.QueryEqualOperation
	QueryUnequalOperation           QueryOperationType = model.QueryUnequalOperation
	QueryAnyValueInFeatureOperation QueryOperationType = model.QueryAnyValueInFeatureOperation
)

type Selection

type Selection = model.Selection

type TestClient

type TestClient struct {
	// contains filtered or unexported fields
}

func NewTestClient

func NewTestClient() *TestClient

func (*TestClient) CheckUserOrGroup

func (this *TestClient) CheckUserOrGroup(token string, kind string, resource string, rights string) (err error)

func (*TestClient) GetRights

func (this *TestClient) GetRights(_ string, resource string, id string) (result model.ResourceRights, err error)

func (*TestClient) GetTermAggregation

func (this *TestClient) GetTermAggregation(token string, kind string, rights string, field string, limit int) (result []model.TermAggregationResultElement, err error)

func (*TestClient) List

func (this *TestClient) List(token string, kind string, options ListOptions) (result []map[string]interface{}, err error)

func (*TestClient) Query

func (this *TestClient) Query(token string, query QueryMessage) (result interface{}, code int, err error)

func (*TestClient) SetRights

func (this *TestClient) SetRights(resource string, id string, rights model.ResourceRights)

func (*TestClient) Total

func (this *TestClient) Total(token string, kind string, options ListOptions) (result int64, err error)

type WithTotal

type WithTotal[Result any] struct {
	Total  int64  `json:"total"`
	Result Result `json:"result"`
}

func QueryWithTotal

func QueryWithTotal[Result any](client Client, token string, query model.QueryMessage) (result WithTotal[Result], code int, err error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL