Documentation
¶
Index ¶
- func AccessTokenFromContext(ctx context.Context) string
- func WithAccessTokenContext(ctx context.Context, token string) context.Context
- type AND
- type AggregateQuery
- type AggregateRequest
- func (r *AggregateRequest[T]) SendBy(client *Client) ([]T, error)
- func (r *AggregateRequest[T]) SetAggregate(rule AggregateRule) *AggregateRequest[T]
- func (r *AggregateRequest[T]) SetContext(ctx context.Context) *AggregateRequest[T]
- func (r *AggregateRequest[T]) SetFilter(rule FilterRule) *AggregateRequest[T]
- func (r *AggregateRequest[T]) SetGroupBy(groupBy []string) *AggregateRequest[T]
- func (r *AggregateRequest[T]) SetIsSystem(v bool) *AggregateRequest[T]
- func (r *AggregateRequest[T]) SetLimit(limit int) *AggregateRequest[T]
- func (r *AggregateRequest[T]) SetOffset(offset int) *AggregateRequest[T]
- func (r *AggregateRequest[T]) SetPage(page int) *AggregateRequest[T]
- func (r *AggregateRequest[T]) SetSearch(search string) *AggregateRequest[T]
- func (r *AggregateRequest[T]) SetSort(sort []string) *AggregateRequest[T]
- func (r *AggregateRequest[T]) SetToken(token string) *AggregateRequest[T]
- type AggregateRule
- type AuthLoginParams
- type AuthLogoutParams
- type AuthMode
- type AuthProvider
- type AuthRefreshParams
- type AuthResponsePayload
- type AuthResult
- type Avg
- type AvgDistinct
- type Between
- type ByField
- type Client
- func (c *Client) AuthLogin(ctx context.Context, options AuthLoginParams) (AuthResult, error)
- func (c *Client) AuthLogout(ctx context.Context, options AuthLogoutParams) error
- func (c *Client) AuthOTPVerify(ctx context.Context, options OTPVerifyParams) (AuthResult, error)
- func (c *Client) AuthPasswordReset(ctx context.Context, options PasswordResetParams) error
- func (c *Client) AuthProviders(ctx context.Context) ([]AuthProvider, error)
- func (c *Client) AuthRefresh(ctx context.Context, options AuthRefreshParams) (AuthResult, error)
- func (c *Client) AuthResetPasswordRequest(ctx context.Context, options PasswordResetRequestParams) error
- func (c *Client) RandomString(ctx context.Context, length int) (string, error)
- func (c *Client) ServerHealth(ctx context.Context) (string, error)
- func (c *Client) ServerInfo(ctx context.Context) (ServerInfo, error)
- func (c *Client) ServerPing(ctx context.Context) (string, error)
- type ClientOption
- type Contains
- type Count
- type CountDistinct
- type CreateItemRequest
- func (r *CreateItemRequest[T]) SendBy(client *Client) (T, error)
- func (r *CreateItemRequest[T]) SetContext(ctx context.Context) *CreateItemRequest[T]
- func (r *CreateItemRequest[T]) SetData(data any) *CreateItemRequest[T]
- func (r *CreateItemRequest[T]) SetDeep(v map[string]DeepQuery) *CreateItemRequest[T]
- func (r *CreateItemRequest[T]) SetIsSystem(v bool) *CreateItemRequest[T]
- func (r *CreateItemRequest[T]) SetToken(token string) *CreateItemRequest[T]
- type DeepQuery
- type DeleteItemRequest
- type DeleteItemsQuery
- type DeleteItemsRequest
- func (r *DeleteItemsRequest[ID]) SendBy(client *Client) error
- func (r *DeleteItemsRequest[ID]) SetContext(ctx context.Context) *DeleteItemsRequest[ID]
- func (r *DeleteItemsRequest[ID]) SetFilter(rule FilterRule) *DeleteItemsRequest[ID]
- func (r *DeleteItemsRequest[ID]) SetIDs(ids ...ID) *DeleteItemsRequest[ID]
- func (r *DeleteItemsRequest[ID]) SetIsSystem(v bool) *DeleteItemsRequest[ID]
- func (r *DeleteItemsRequest[ID]) SetToken(token string) *DeleteItemsRequest[ID]
- type DeleteItemsRequestPayload
- type EndsWith
- type Equal
- type Error
- type ErrorCode
- type ErrorExtensions
- type Errors
- type ErrorsPayload
- type FilterRule
- type GreaterThan
- type GreaterThanOrEqual
- type Has
- type IContains
- type IEndsWith
- type IStartsWith
- type IsEmpty
- type IsNotEmpty
- type IsNotNull
- type IsNotOneOf
- type IsNull
- type IsOneOf
- type LessThan
- type LessThanOrEqual
- type Like
- type Many
- type Max
- type Min
- type NBetween
- type NContains
- type NEndsWith
- type NHas
- type NLike
- type NStartsWith
- type None
- type NotEqual
- type OR
- type OTPVerifyParams
- type PasswordResetParams
- type PasswordResetRequestParams
- type ReadItemPayload
- type ReadItemQuery
- type ReadItemRequest
- func (r *ReadItemRequest[T]) SendBy(client *Client) (T, error)
- func (r *ReadItemRequest[T]) SetContext(ctx context.Context) *ReadItemRequest[T]
- func (r *ReadItemRequest[T]) SetDeep(v map[string]DeepQuery) *ReadItemRequest[T]
- func (r *ReadItemRequest[T]) SetIsSystem(v bool) *ReadItemRequest[T]
- func (r *ReadItemRequest[T]) SetToken(token string) *ReadItemRequest[T]
- type ReadItemsPayload
- type ReadItemsQuery
- type ReadItemsRequest
- func (r *ReadItemsRequest[T]) SendBy(client *Client) ([]T, error)
- func (r *ReadItemsRequest[T]) SetAlias(v map[string]string) *ReadItemsRequest[T]
- func (r *ReadItemsRequest[T]) SetContext(ctx context.Context) *ReadItemsRequest[T]
- func (r *ReadItemsRequest[T]) SetDeep(v map[string]DeepQuery) *ReadItemsRequest[T]
- func (r *ReadItemsRequest[T]) SetFilter(rule FilterRule) *ReadItemsRequest[T]
- func (r *ReadItemsRequest[T]) SetIsSystem(v bool) *ReadItemsRequest[T]
- func (r *ReadItemsRequest[T]) SetLimit(limit int) *ReadItemsRequest[T]
- func (r *ReadItemsRequest[T]) SetOffset(offset int) *ReadItemsRequest[T]
- func (r *ReadItemsRequest[T]) SetPage(page int) *ReadItemsRequest[T]
- func (r *ReadItemsRequest[T]) SetSearch(search string) *ReadItemsRequest[T]
- func (r *ReadItemsRequest[T]) SetSort(sort []string) *ReadItemsRequest[T]
- func (r *ReadItemsRequest[T]) SetToken(token string) *ReadItemsRequest[T]
- type ReadSingletonQuery
- type ReadSingletonRequest
- func (r *ReadSingletonRequest[T]) SendBy(client *Client) (T, error)
- func (r *ReadSingletonRequest[T]) SetContext(ctx context.Context) *ReadSingletonRequest[T]
- func (r *ReadSingletonRequest[T]) SetDeep(deep map[string]DeepQuery) *ReadSingletonRequest[T]
- func (r *ReadSingletonRequest[T]) SetIsSystem(v bool) *ReadSingletonRequest[T]
- func (r *ReadSingletonRequest[T]) SetToken(token string) *ReadSingletonRequest[T]
- type ServerInfo
- type Some
- type StartsWith
- type Sum
- type SumDistinct
- type UpdateItemRequest
- func (r *UpdateItemRequest[T]) SendBy(client *Client) (T, error)
- func (r *UpdateItemRequest[T]) SetChanges(changes any) *UpdateItemRequest[T]
- func (r *UpdateItemRequest[T]) SetContext(ctx context.Context) *UpdateItemRequest[T]
- func (r *UpdateItemRequest[T]) SetDeep(v map[string]DeepQuery) *UpdateItemRequest[T]
- func (r *UpdateItemRequest[T]) SetIsSystem(v bool) *UpdateItemRequest[T]
- func (r *UpdateItemRequest[T]) SetToken(token string) *UpdateItemRequest[T]
- type UpdateItemsRequest
- func (r *UpdateItemsRequest[T]) SendBy(client *Client) (T, error)
- func (r *UpdateItemsRequest[T]) SetChanges(changes any) *UpdateItemsRequest[T]
- func (r *UpdateItemsRequest[T]) SetContext(ctx context.Context) *UpdateItemsRequest[T]
- func (r *UpdateItemsRequest[T]) SetDeep(v map[string]DeepQuery) *UpdateItemsRequest[T]
- func (r *UpdateItemsRequest[T]) SetFilter(rule FilterRule) *UpdateItemsRequest[T]
- func (r *UpdateItemsRequest[T]) SetIsSystem(v bool) *UpdateItemsRequest[T]
- func (r *UpdateItemsRequest[T]) SetToken(token string) *UpdateItemsRequest[T]
- type UpdateItemsRequetBody
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AccessTokenFromContext ¶
Types ¶
type AND ¶
type AND struct {
Filters []FilterRule `json:"_and"`
}
type AggregateQuery ¶
type AggregateQuery struct {
Aggregate AggregateRule `url:"aggregate,omitempty"`
GroupBy []string `url:"groupBy,omitempty"`
Filter helpers.URLParamJSON `url:"filter,omitempty"`
Sort []string `url:"sort,omitempty"`
Search string `url:"search,omitempty"`
Offset int `url:"offset,omitempty"`
Limit int `url:"limit,omitempty"`
Page int `url:"page,omitempty"`
}
type AggregateRequest ¶
type AggregateRequest[T any] struct { AggregateQuery Collection string IsSystem bool Token string // contains filtered or unexported fields }
func NewAggregate ¶
func NewAggregate[T any](collection string) *AggregateRequest[T]
func (*AggregateRequest[T]) SendBy ¶
func (r *AggregateRequest[T]) SendBy(client *Client) ([]T, error)
func (*AggregateRequest[T]) SetAggregate ¶
func (r *AggregateRequest[T]) SetAggregate(rule AggregateRule) *AggregateRequest[T]
func (*AggregateRequest[T]) SetContext ¶
func (r *AggregateRequest[T]) SetContext(ctx context.Context) *AggregateRequest[T]
func (*AggregateRequest[T]) SetFilter ¶
func (r *AggregateRequest[T]) SetFilter(rule FilterRule) *AggregateRequest[T]
func (*AggregateRequest[T]) SetGroupBy ¶
func (r *AggregateRequest[T]) SetGroupBy(groupBy []string) *AggregateRequest[T]
func (*AggregateRequest[T]) SetIsSystem ¶
func (r *AggregateRequest[T]) SetIsSystem(v bool) *AggregateRequest[T]
func (*AggregateRequest[T]) SetLimit ¶
func (r *AggregateRequest[T]) SetLimit(limit int) *AggregateRequest[T]
func (*AggregateRequest[T]) SetOffset ¶
func (r *AggregateRequest[T]) SetOffset(offset int) *AggregateRequest[T]
func (*AggregateRequest[T]) SetPage ¶
func (r *AggregateRequest[T]) SetPage(page int) *AggregateRequest[T]
func (*AggregateRequest[T]) SetSearch ¶
func (r *AggregateRequest[T]) SetSearch(search string) *AggregateRequest[T]
func (*AggregateRequest[T]) SetSort ¶
func (r *AggregateRequest[T]) SetSort(sort []string) *AggregateRequest[T]
func (*AggregateRequest[T]) SetToken ¶
func (r *AggregateRequest[T]) SetToken(token string) *AggregateRequest[T]
type AggregateRule ¶
type AuthLoginParams ¶
type AuthLogoutParams ¶
type AuthProvider ¶
type AuthProvider struct {
Name string `json:"name"`
Driver string `json:"driver"`
Icon string `json:"icon,omitempty"`
Label string `json:"label,omitempty"`
RedirectURL string `json:"redirect_url,omitempty"`
AuthURL string `json:"auth_url,omitempty"`
ClientID string `json:"client_id,omitempty"`
Scope []string `json:"scope,omitempty"`
Additional map[string]string `json:"additional,omitempty"`
}
type AuthRefreshParams ¶
type AuthResponsePayload ¶
type AuthResponsePayload struct {
Data AuthResult `json:"data"`
}
type AuthResult ¶
type AvgDistinct ¶
type AvgDistinct struct {
Fields []string
}
func (AvgDistinct) EncodeValues ¶
func (agg AvgDistinct) EncodeValues(key string, v *url.Values) error
type ByField ¶
type ByField struct {
Name string `json:"-"`
Filter FilterRule `json:"-"`
}
func (ByField) MarshalJSON ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) AuthLogin ¶
func (c *Client) AuthLogin(ctx context.Context, options AuthLoginParams) (AuthResult, error)
func (*Client) AuthLogout ¶
func (c *Client) AuthLogout(ctx context.Context, options AuthLogoutParams) error
func (*Client) AuthOTPVerify ¶
func (c *Client) AuthOTPVerify(ctx context.Context, options OTPVerifyParams) (AuthResult, error)
func (*Client) AuthPasswordReset ¶
func (c *Client) AuthPasswordReset(ctx context.Context, options PasswordResetParams) error
func (*Client) AuthProviders ¶
func (c *Client) AuthProviders(ctx context.Context) ([]AuthProvider, error)
func (*Client) AuthRefresh ¶
func (c *Client) AuthRefresh(ctx context.Context, options AuthRefreshParams) (AuthResult, error)
func (*Client) AuthResetPasswordRequest ¶
func (c *Client) AuthResetPasswordRequest(ctx context.Context, options PasswordResetRequestParams) error
func (*Client) RandomString ¶
func (*Client) ServerInfo ¶
func (c *Client) ServerInfo(ctx context.Context) (ServerInfo, error)
type ClientOption ¶
type ClientOption func(c *Client)
func WithExtractTokenFromContext ¶
func WithExtractTokenFromContext(enabled bool) ClientOption
func WithStaticToken ¶
func WithStaticToken(token string) ClientOption
type CountDistinct ¶
type CountDistinct struct {
Fields []string
}
func (CountDistinct) EncodeValues ¶
func (agg CountDistinct) EncodeValues(key string, v *url.Values) error
type CreateItemRequest ¶
type CreateItemRequest[T any] struct { ReadItemQuery Collection string IsSystem bool Data any Token string // contains filtered or unexported fields }
func NewCreateItem ¶
func NewCreateItem[T any](collection string, data any) *CreateItemRequest[T]
func (*CreateItemRequest[T]) SendBy ¶
func (r *CreateItemRequest[T]) SendBy(client *Client) (T, error)
func (*CreateItemRequest[T]) SetContext ¶
func (r *CreateItemRequest[T]) SetContext(ctx context.Context) *CreateItemRequest[T]
func (*CreateItemRequest[T]) SetData ¶
func (r *CreateItemRequest[T]) SetData(data any) *CreateItemRequest[T]
func (*CreateItemRequest[T]) SetDeep ¶
func (r *CreateItemRequest[T]) SetDeep(v map[string]DeepQuery) *CreateItemRequest[T]
func (*CreateItemRequest[T]) SetIsSystem ¶
func (r *CreateItemRequest[T]) SetIsSystem(v bool) *CreateItemRequest[T]
func (*CreateItemRequest[T]) SetToken ¶
func (r *CreateItemRequest[T]) SetToken(token string) *CreateItemRequest[T]
type DeleteItemRequest ¶
type DeleteItemRequest struct {
Collection, ID string
IsSystem bool
Token string
// contains filtered or unexported fields
}
func NewDeleteItem ¶
func NewDeleteItem(collection, id string) *DeleteItemRequest
func (*DeleteItemRequest) SendBy ¶
func (r *DeleteItemRequest) SendBy(client *Client) error
func (*DeleteItemRequest) SetContext ¶
func (r *DeleteItemRequest) SetContext(ctx context.Context) *DeleteItemRequest
func (*DeleteItemRequest) SetIsSystem ¶
func (r *DeleteItemRequest) SetIsSystem(v bool) *DeleteItemRequest
func (*DeleteItemRequest) SetToken ¶
func (r *DeleteItemRequest) SetToken(token string) *DeleteItemRequest
type DeleteItemsQuery ¶
type DeleteItemsQuery struct {
Filter FilterRule `json:"filter"`
}
type DeleteItemsRequest ¶
type DeleteItemsRequest[ID comparable] struct { DeleteItemsRequestPayload Collection string IsSystem bool IDs []ID Token string // contains filtered or unexported fields }
func NewDeleteItems ¶
func NewDeleteItems[ID comparable](collection string, ids ...ID) *DeleteItemsRequest[ID]
func (*DeleteItemsRequest[ID]) SendBy ¶
func (r *DeleteItemsRequest[ID]) SendBy(client *Client) error
func (*DeleteItemsRequest[ID]) SetContext ¶
func (r *DeleteItemsRequest[ID]) SetContext(ctx context.Context) *DeleteItemsRequest[ID]
func (*DeleteItemsRequest[ID]) SetFilter ¶
func (r *DeleteItemsRequest[ID]) SetFilter(rule FilterRule) *DeleteItemsRequest[ID]
func (*DeleteItemsRequest[ID]) SetIDs ¶
func (r *DeleteItemsRequest[ID]) SetIDs(ids ...ID) *DeleteItemsRequest[ID]
func (*DeleteItemsRequest[ID]) SetIsSystem ¶
func (r *DeleteItemsRequest[ID]) SetIsSystem(v bool) *DeleteItemsRequest[ID]
func (*DeleteItemsRequest[ID]) SetToken ¶
func (r *DeleteItemsRequest[ID]) SetToken(token string) *DeleteItemsRequest[ID]
type DeleteItemsRequestPayload ¶
type DeleteItemsRequestPayload struct {
Query DeleteItemsQuery `json:"query"`
}
type Error ¶
type Error struct {
Extensions ErrorExtensions `json:"extensions,omitempty"`
Message string `json:"message"`
}
type ErrorCode ¶
type ErrorCode string
const ( ForbiddenErrorCode ErrorCode = "FORBIDDEN" InvalidIPErrorCode ErrorCode = "INVALID_IP" InvalidOTPErrorCode ErrorCode = "INVALID_OTP" InvalidQueryErrorCode ErrorCode = "INVALID_QUERY" InvalidTokenErrorCode ErrorCode = "INVALID_TOKEN" TokenExpiredErrorCode ErrorCode = "TOKEN_EXPIRED" RouteNotFoundErrorCode ErrorCode = "ROUTE_NOT_FOUND" InvalidPayloadErrorCode ErrorCode = "INVALID_PAYLOAD" RequestExceededErrorCode ErrorCode = "REQUESTS_EXCEEDED" FailedValidationErrorCode ErrorCode = "FAILED_VALIDATION" InvalidCredentialsErrorCode ErrorCode = "INVALID_CREDENTIALS" UnprocessableContentErrorCode ErrorCode = "UNPROCESSABLE_CONTENT" UnsupportedMediaTypeErrorCode ErrorCode = "UNSUPPORTED_MEDIA_TYPE" )
type ErrorExtensions ¶
type ErrorExtensions struct {
Code ErrorCode `json:"code,omitempty"`
}
type ErrorsPayload ¶
type ErrorsPayload struct {
Errors Errors `json:"errors"`
}
type FilterRule ¶
type FilterRule interface {
// contains filtered or unexported methods
}
type GreaterThan ¶
type GreaterThan[T any] struct { Value T `json:"_gt"` }
type GreaterThanOrEqual ¶
type GreaterThanOrEqual[T any] struct { Value T `json:"_gte"` }
type Has ¶
type Has struct {
Filter FilterRule `json:"_has"`
}
type IStartsWith ¶
type IStartsWith struct {
Value string `json:"_istarts_with"`
}
type IsNotEmpty ¶
type IsNotEmpty struct {
Value bool `json:"_nempty"`
}
type IsNotOneOf ¶
type IsNotOneOf[T any] struct { Values []T `json:"_nin"` }
type LessThanOrEqual ¶
type LessThanOrEqual[T any] struct { Value T `json:"_lte"` }
type Many ¶
type Many struct {
Rules []AggregateRule
}
type NHas ¶
type NHas struct {
Filter FilterRule `json:"_nhas"`
}
type NStartsWith ¶
type NStartsWith struct {
Value string `json:"_nstarts_with"`
}
type None ¶
type None struct {
Filter FilterRule `json:"_none"`
}
type OR ¶
type OR struct {
Filters []FilterRule `json:"_or"`
}
type OTPVerifyParams ¶
type OTPVerifyParams struct {
OTP string `json:"otp"`
}
type PasswordResetParams ¶
type ReadItemPayload ¶
type ReadItemPayload[T any] struct { Data T `json:"data"` }
type ReadItemQuery ¶
type ReadItemQuery struct {
Deep helpers.URLParamJSON `url:"deep,omitempty"`
}
type ReadItemRequest ¶
type ReadItemRequest[T any] struct { ReadItemQuery Collection, ID string IsSystem bool Token string // contains filtered or unexported fields }
func NewReadItem ¶
func NewReadItem[T any](collection, id string) *ReadItemRequest[T]
func (*ReadItemRequest[T]) SendBy ¶
func (r *ReadItemRequest[T]) SendBy(client *Client) (T, error)
func (*ReadItemRequest[T]) SetContext ¶
func (r *ReadItemRequest[T]) SetContext(ctx context.Context) *ReadItemRequest[T]
func (*ReadItemRequest[T]) SetDeep ¶
func (r *ReadItemRequest[T]) SetDeep(v map[string]DeepQuery) *ReadItemRequest[T]
func (*ReadItemRequest[T]) SetIsSystem ¶
func (r *ReadItemRequest[T]) SetIsSystem(v bool) *ReadItemRequest[T]
func (*ReadItemRequest[T]) SetToken ¶
func (r *ReadItemRequest[T]) SetToken(token string) *ReadItemRequest[T]
type ReadItemsPayload ¶
type ReadItemsPayload[T any] struct { Data []T `json:"data"` }
type ReadItemsQuery ¶
type ReadItemsQuery struct {
Alias map[string]string `url:"alias,omitempty"`
Filter helpers.URLParamJSON `url:"filter,omitempty"`
Sort []string `url:"sort,omitempty"`
Deep helpers.URLParamJSON `url:"deep,omitempty"`
Search string `url:"search,omitempty"`
Offset int `url:"offset,omitempty"`
Limit int `url:"limit,omitempty"`
Page int `url:"page,omitempty"`
}
type ReadItemsRequest ¶
type ReadItemsRequest[T any] struct { ReadItemsQuery Collection string IsSystem bool Token string // contains filtered or unexported fields }
func NewReadItems ¶
func NewReadItems[T any](collection string) *ReadItemsRequest[T]
func (*ReadItemsRequest[T]) SendBy ¶
func (r *ReadItemsRequest[T]) SendBy(client *Client) ([]T, error)
func (*ReadItemsRequest[T]) SetAlias ¶
func (r *ReadItemsRequest[T]) SetAlias(v map[string]string) *ReadItemsRequest[T]
func (*ReadItemsRequest[T]) SetContext ¶
func (r *ReadItemsRequest[T]) SetContext(ctx context.Context) *ReadItemsRequest[T]
func (*ReadItemsRequest[T]) SetDeep ¶
func (r *ReadItemsRequest[T]) SetDeep(v map[string]DeepQuery) *ReadItemsRequest[T]
func (*ReadItemsRequest[T]) SetFilter ¶
func (r *ReadItemsRequest[T]) SetFilter(rule FilterRule) *ReadItemsRequest[T]
func (*ReadItemsRequest[T]) SetIsSystem ¶
func (r *ReadItemsRequest[T]) SetIsSystem(v bool) *ReadItemsRequest[T]
func (*ReadItemsRequest[T]) SetLimit ¶
func (r *ReadItemsRequest[T]) SetLimit(limit int) *ReadItemsRequest[T]
func (*ReadItemsRequest[T]) SetOffset ¶
func (r *ReadItemsRequest[T]) SetOffset(offset int) *ReadItemsRequest[T]
func (*ReadItemsRequest[T]) SetPage ¶
func (r *ReadItemsRequest[T]) SetPage(page int) *ReadItemsRequest[T]
func (*ReadItemsRequest[T]) SetSearch ¶
func (r *ReadItemsRequest[T]) SetSearch(search string) *ReadItemsRequest[T]
func (*ReadItemsRequest[T]) SetSort ¶
func (r *ReadItemsRequest[T]) SetSort(sort []string) *ReadItemsRequest[T]
func (*ReadItemsRequest[T]) SetToken ¶
func (r *ReadItemsRequest[T]) SetToken(token string) *ReadItemsRequest[T]
type ReadSingletonQuery ¶
type ReadSingletonRequest ¶
type ReadSingletonRequest[T any] struct { ReadSingletonQuery Collection string IsSystem bool Token string // contains filtered or unexported fields }
func NewReadSingleton ¶
func NewReadSingleton[T any](collection string) *ReadSingletonRequest[T]
func (*ReadSingletonRequest[T]) SendBy ¶
func (r *ReadSingletonRequest[T]) SendBy(client *Client) (T, error)
func (*ReadSingletonRequest[T]) SetContext ¶
func (r *ReadSingletonRequest[T]) SetContext(ctx context.Context) *ReadSingletonRequest[T]
func (*ReadSingletonRequest[T]) SetDeep ¶
func (r *ReadSingletonRequest[T]) SetDeep(deep map[string]DeepQuery) *ReadSingletonRequest[T]
func (*ReadSingletonRequest[T]) SetIsSystem ¶
func (r *ReadSingletonRequest[T]) SetIsSystem(v bool) *ReadSingletonRequest[T]
func (*ReadSingletonRequest[T]) SetToken ¶
func (r *ReadSingletonRequest[T]) SetToken(token string) *ReadSingletonRequest[T]
type ServerInfo ¶
type ServerInfo struct {
Project struct {
ProjectName string `json:"project_name"`
ProjectLogo string `json:"project_logo,omitempty"`
PublicURL string `json:"public_url,omitempty"`
} `json:"project"`
Directus struct {
Version string `json:"version"`
} `json:"directus"`
Node struct {
Version string `json:"version"`
Uptime int64 `json:"uptime"`
} `json:"node"`
OS struct {
Type string `json:"type"`
Version string `json:"version"`
Uptime int64 `json:"uptime"`
TotalMem int64 `json:"totalmem"`
} `json:"os"`
}
type Some ¶
type Some struct {
Filter FilterRule `json:"_some"`
}
type StartsWith ¶
type StartsWith struct {
Value string `json:"_starts_with"`
}
type SumDistinct ¶
type SumDistinct struct {
Fields []string
}
func (SumDistinct) EncodeValues ¶
func (agg SumDistinct) EncodeValues(key string, v *url.Values) error
type UpdateItemRequest ¶
type UpdateItemRequest[T any] struct { ReadItemQuery Collection, ID string IsSystem bool Changes any Token string // contains filtered or unexported fields }
func NewUpdateItem ¶
func NewUpdateItem[T any](collection, id string, changes any) *UpdateItemRequest[T]
func (*UpdateItemRequest[T]) SendBy ¶
func (r *UpdateItemRequest[T]) SendBy(client *Client) (T, error)
func (*UpdateItemRequest[T]) SetChanges ¶
func (r *UpdateItemRequest[T]) SetChanges(changes any) *UpdateItemRequest[T]
func (*UpdateItemRequest[T]) SetContext ¶
func (r *UpdateItemRequest[T]) SetContext(ctx context.Context) *UpdateItemRequest[T]
func (*UpdateItemRequest[T]) SetDeep ¶
func (r *UpdateItemRequest[T]) SetDeep(v map[string]DeepQuery) *UpdateItemRequest[T]
func (*UpdateItemRequest[T]) SetIsSystem ¶
func (r *UpdateItemRequest[T]) SetIsSystem(v bool) *UpdateItemRequest[T]
func (*UpdateItemRequest[T]) SetToken ¶
func (r *UpdateItemRequest[T]) SetToken(token string) *UpdateItemRequest[T]
type UpdateItemsRequest ¶
type UpdateItemsRequest[T any] struct { ReadItemsQuery Collection string Keys []string IsSystem bool Changes any Token string // contains filtered or unexported fields }
func NewUpdateItems ¶
func NewUpdateItems[T any](collection string, keys []string, changes any) *UpdateItemsRequest[T]
func (*UpdateItemsRequest[T]) SendBy ¶
func (r *UpdateItemsRequest[T]) SendBy(client *Client) (T, error)
func (*UpdateItemsRequest[T]) SetChanges ¶
func (r *UpdateItemsRequest[T]) SetChanges(changes any) *UpdateItemsRequest[T]
func (*UpdateItemsRequest[T]) SetContext ¶
func (r *UpdateItemsRequest[T]) SetContext(ctx context.Context) *UpdateItemsRequest[T]
func (*UpdateItemsRequest[T]) SetDeep ¶
func (r *UpdateItemsRequest[T]) SetDeep(v map[string]DeepQuery) *UpdateItemsRequest[T]
func (*UpdateItemsRequest[T]) SetFilter ¶
func (r *UpdateItemsRequest[T]) SetFilter(rule FilterRule) *UpdateItemsRequest[T]
func (*UpdateItemsRequest[T]) SetIsSystem ¶
func (r *UpdateItemsRequest[T]) SetIsSystem(v bool) *UpdateItemsRequest[T]
func (*UpdateItemsRequest[T]) SetToken ¶
func (r *UpdateItemsRequest[T]) SetToken(token string) *UpdateItemsRequest[T]
type UpdateItemsRequetBody ¶
Source Files
¶
- aggregate.go
- aggregate_rules.go
- auth_login.go
- auth_logout.go
- auth_otp_verify.go
- auth_providers.go
- auth_refresh.go
- auth_reset_password.go
- client.go
- client_options.go
- context.go
- create_item.go
- delete_item.go
- delete_items.go
- errors.go
- filter_rules.go
- read_item.go
- read_items.go
- read_singleton.go
- server_health.go
- server_info.go
- server_ping.go
- update_item.go
- update_items.go
- utils.go
Click to show internal directories.
Click to hide internal directories.