cloudserver

package
v1.14.2 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrDashboardSessionCodecRequired = errors.New("dashboard session codec is required for dashboard auth")

Functions

This section is empty.

Types

type Authenticator added in v1.13.0

type Authenticator interface {
	Authorize(r *http.Request) error
}

type ChunkStore added in v1.13.0

type ChunkStore interface {
	ReadManifest(ctx context.Context, project string) (*engramsync.Manifest, error)
	WriteChunk(ctx context.Context, project, chunkID, createdBy, clientCreatedAt string, payload []byte) error
	ReadChunk(ctx context.Context, project, chunkID string) ([]byte, error)
	KnownSessionIDs(ctx context.Context, project string) (map[string]struct{}, error)
}

type CloudServer

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

func New

func New(store ChunkStore, authSvc Authenticator, port int, opts ...Option) *CloudServer

func (*CloudServer) Handler

func (s *CloudServer) Handler() http.Handler

func (*CloudServer) Start

func (s *CloudServer) Start() error

type EnrolledProjectsProvider added in v1.13.0

type EnrolledProjectsProvider interface {
	EnrolledProjects() []string
}

EnrolledProjectsProvider is an optional extension of ProjectAuthorizer that returns the list of enrolled projects for the authenticated caller.

type MutationEntry added in v1.13.0

type MutationEntry = cloudstore.MutationEntry

MutationEntry is an alias for cloudstore.MutationEntry (canonical wire type). Using a type alias ensures cloudstore.CloudStore satisfies MutationStore without adapter shims.

type MutationStore added in v1.13.0

type MutationStore interface {
	InsertMutationBatch(ctx context.Context, batch []cloudstore.MutationEntry) ([]int64, error)
	ListMutationsSince(ctx context.Context, sinceSeq int64, limit int, allowedProjects []string) ([]cloudstore.StoredMutation, bool, int64, error)
	IsProjectSyncEnabled(project string) (bool, error)
}

MutationStore is the subset of store methods needed by mutation handlers. It is satisfied by cloudstore.CloudStore and by test fakes. BC1: Using cloudstore types directly (via alias) ensures the type assertion s.store.(MutationStore) succeeds at runtime with a real *cloudstore.CloudStore.

type Option

type Option func(*CloudServer)

func WithDashboardAdminToken added in v1.13.0

func WithDashboardAdminToken(adminToken string) Option

func WithHost added in v1.13.0

func WithHost(host string) Option

func WithProjectAuthorizer added in v1.13.0

func WithProjectAuthorizer(authorizer ProjectAuthorizer) Option

func WithSyncStatusProvider added in v1.13.0

func WithSyncStatusProvider(provider dashboard.SyncStatusProvider) Option

type ProjectAuthorizer added in v1.13.0

type ProjectAuthorizer interface {
	AuthorizeProject(project string) error
}

type StoredMutation added in v1.13.0

type StoredMutation = cloudstore.StoredMutation

StoredMutation is an alias for cloudstore.StoredMutation (canonical read type).

Jump to

Keyboard shortcuts

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