Documentation
¶
Index ¶
- func FieldsFromContext[T any](ctx context.Context) (*T, error)
- func Handle(i any) *handlerFunc
- func NewFailedValidationError(collection, field, message string) error
- func NewInvalidError(message string) error
- func NewServer(opts ...ServerOption) (string, http.Handler)
- func PingFn(ctx context.Context) (string, error)
- type Accountability
- type ErrorReporter
- type Partial
- type RawTrigger
- type ServerOption
- type Trigger
- type TriggerKey
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FieldsFromContext ¶ added in v0.8.0
func NewFailedValidationError ¶ added in v0.7.0
func NewInvalidError ¶ added in v0.7.0
Types ¶
type Accountability ¶
type Accountability struct {
User string `json:"user"`
Role string `json:"role"`
Admin bool `json:"admin"`
App bool `json:"app"`
IP string `json:"ip"`
UserAgent string `json:"userAgent"`
Origin string `json:"origin"`
}
func AccountabilityFromContext ¶
func AccountabilityFromContext(ctx context.Context) *Accountability
type ErrorReporter ¶ added in v0.6.0
type Partial ¶ added in v0.9.0
Partial reads the inner object fields and stores the unknown ones in a map. When marshaled again the unknown fields will be kept and any known fields with the same name will override them.
func (*Partial[T]) MarshalJSON ¶ added in v0.9.0
func (*Partial[T]) UnmarshalJSON ¶ added in v0.9.0
type RawTrigger ¶
type RawTrigger struct {
Event string
Keys []TriggerKey
Collection string
Payload json.RawMessage
// Path is the URL path of a manual invokation.
Path string
// contains filtered or unexported fields
}
func RawTriggerFromContext ¶
func RawTriggerFromContext(ctx context.Context) *RawTrigger
type ServerOption ¶ added in v0.6.0
type ServerOption func(r *serverOpts)
func WithErrorReporter ¶ added in v0.6.0
func WithErrorReporter(reporter ErrorReporter) ServerOption
func WithLogger ¶
func WithLogger(logger *slog.Logger) ServerOption
func WithSecurityToken ¶
func WithSecurityToken(token string) ServerOption
type Trigger ¶
type Trigger[Payload any] struct { Event string Keys []TriggerKey Collection string Payload Payload // Path is the URL path of a manual invokation. Path string }
type TriggerKey ¶
func (*TriggerKey) IsEmpty ¶ added in v0.5.0
func (n *TriggerKey) IsEmpty() bool
func (*TriggerKey) String ¶
func (n *TriggerKey) String() string
func (*TriggerKey) UnmarshalJSON ¶
func (n *TriggerKey) UnmarshalJSON(data []byte) error
Click to show internal directories.
Click to hide internal directories.