Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
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 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 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 StoredMutation ¶ added in v1.13.0
type StoredMutation = cloudstore.StoredMutation
StoredMutation is an alias for cloudstore.StoredMutation (canonical read type).