server

package
v0.1.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnauthenticated = errors.New("meldbase server: unauthenticated")
	ErrForbidden       = errors.New("meldbase server: forbidden")
)

Functions

This section is empty.

Types

type Authenticator

type Authenticator interface {
	AuthenticateHTTP(*http.Request) (Principal, error)
}

type Config

type Config struct {
	DB                            *meldbase.DB
	Authenticator                 Authenticator
	Authorizer                    Authorizer
	PublicRealtimeURL             string
	OriginPatterns                []string
	AllowedHTTPOrigins            []string
	TicketTTL                     time.Duration
	ResumeTokenKey                []byte
	ResumeTokenTTL                time.Duration
	MaxBodyBytes                  int
	MaxSubscriptionsPerConnection int
	QueryLimits                   meldbase.QueryLimits
}

type DeletePolicy

type DeletePolicy struct {
	QueryPolicy
	MaxAffected int
}

type Handler

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

func New

func New(config Config) (*Handler, error)

func (*Handler) ServeHTTP

func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type InsertPolicy

type InsertPolicy struct {
	AllowAllInputFields  bool
	AllowedInputFields   map[string]struct{}
	SetFields            meldbase.Document
	AllowAllResultFields bool
	AllowedResultFields  map[string]struct{}
}

type Principal

type Principal struct {
	Subject string
	Tenant  string
}

type QueryPolicy

type QueryPolicy struct {
	PolicyVersion        string
	Constraint           *meldbase.QuerySpec
	MaxResults           int
	AllowAllQueryPaths   bool
	AllowedQueryPaths    map[string]struct{}
	AllowAllResultFields bool
	AllowedResultFields  map[string]struct{}
}

type UpdatePolicy

type UpdatePolicy struct {
	QueryPolicy
	AllowAllUpdatePaths bool
	AllowedUpdatePaths  map[string]struct{}
	MaxAffected         int
}

Jump to

Keyboard shortcuts

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