types

package
v0.0.0-...-1d800d4 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2024 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Doc

type Doc struct {
	DocCore
	LastUpdatedCtx
	sharedTypes.Version
	UnFlushedTime
	DocId               sharedTypes.UUID
	JustLoadedIntoRedis bool
}

func DocFromFlushedDoc

func DocFromFlushedDoc(flushedDoc *project.Doc, projectId, docId sharedTypes.UUID) *Doc

func (*Doc) ToDocContentSnapshot

func (d *Doc) ToDocContentSnapshot() DocContentSnapshot

func (*Doc) ToForDocUpdate

func (d *Doc) ToForDocUpdate() doc.ForDocUpdate

type DocContentSnapshot

type DocContentSnapshot struct {
	Id            sharedTypes.UUID     `json:"_id"`
	Snapshot      string               `json:"snapshot"`
	PathName      sharedTypes.PathName `json:"pathname"`
	Version       sharedTypes.Version  `json:"v"`
	LastUpdatedAt time.Time            `json:"-"`
}

type DocContentSnapshots

type DocContentSnapshots []DocContentSnapshot

func (DocContentSnapshots) LastUpdatedAt

func (l DocContentSnapshots) LastUpdatedAt() time.Time

type DocCore

type DocCore struct {
	Snapshot  sharedTypes.Snapshot `json:"snapshot"`
	Hash      sharedTypes.Hash     `json:"hash"`
	ProjectId sharedTypes.UUID     `json:"project_id"`
	PathName  sharedTypes.PathName `json:"path_name"`
}

func (*DocCore) DoMarshalJSON

func (core *DocCore) DoMarshalJSON() ([]byte, error)

func (*DocCore) DoUnmarshalJSON

func (core *DocCore) DoUnmarshalJSON(bytes []byte) error

type GetDocResponse

type GetDocResponse struct {
	Ops      []sharedTypes.DocumentUpdate `json:"ops"`
	PathName sharedTypes.PathName         `json:"pathname"`
	Snapshot string                       `json:"snapshot"`
	Version  sharedTypes.Version          `json:"version"`
}

type LastUpdatedCtx

type LastUpdatedCtx struct {
	At time.Time        `json:"at"`
	By sharedTypes.UUID `json:"by,omitempty"`
}

type Options

type Options struct {
	PeriodicFlushAll             redisScanner.PeriodicOptions `json:"periodic_flush_all"`
	Workers                      int                          `json:"workers"`
	PendingUpdatesListShardCount int                          `json:"pending_updates_list_shard_count"`
}

func (*Options) FillFromEnv

func (o *Options) FillFromEnv()

func (*Options) Validate

func (o *Options) Validate() error

type PendingUpdatesListKey

type PendingUpdatesListKey int

func (PendingUpdatesListKey) String

func (p PendingUpdatesListKey) String() string

type RenameDocUpdate

type RenameDocUpdate struct {
	DocId   sharedTypes.UUID
	NewPath sharedTypes.PathName
}

func (RenameDocUpdate) Validate

func (r RenameDocUpdate) Validate() error

type RenameDocUpdates

type RenameDocUpdates []RenameDocUpdate

func (RenameDocUpdates) Validate

func (p RenameDocUpdates) Validate() error

type SetDocRequest

type SetDocRequest struct {
	Snapshot sharedTypes.Snapshot `json:"snapshot"`
	Source   string               `json:"source"`
	UserId   sharedTypes.UUID     `json:"user_id"`
	Undoing  bool                 `json:"undoing"`
}

func (*SetDocRequest) Validate

func (s *SetDocRequest) Validate() error

type UnFlushedTime

type UnFlushedTime int64

Jump to

Keyboard shortcuts

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