Documentation ¶
Index ¶
- Variables
- func CreateHeadsPayload(heads []string) []byte
- func JoinStringsToBytes(strs ...string) []byte
- func ParseHeads(headsPayload []byte) []string
- type Exporter
- type InMemoryTreeStorage
- func (t *InMemoryTreeStorage) AddRawChange(change *treechangeproto.RawTreeChangeWithId) error
- func (t *InMemoryTreeStorage) AddRawChangesSetHeads(changes []*treechangeproto.RawTreeChangeWithId, heads []string) error
- func (t *InMemoryTreeStorage) AllChanges() []*treechangeproto.RawTreeChangeWithId
- func (t *InMemoryTreeStorage) Copy() *InMemoryTreeStorage
- func (t *InMemoryTreeStorage) Delete() error
- func (t *InMemoryTreeStorage) Equal(other *InMemoryTreeStorage) bool
- func (t *InMemoryTreeStorage) GetAllChangeIds() (chs []string, err error)
- func (t *InMemoryTreeStorage) GetAppendRawChange(ctx context.Context, buf []byte, id string) (*treechangeproto.RawTreeChangeWithId, error)
- func (t *InMemoryTreeStorage) GetRawChange(ctx context.Context, changeId string) (*treechangeproto.RawTreeChangeWithId, error)
- func (t *InMemoryTreeStorage) HasChange(ctx context.Context, id string) (bool, error)
- func (t *InMemoryTreeStorage) Heads() ([]string, error)
- func (t *InMemoryTreeStorage) Id() string
- func (t *InMemoryTreeStorage) Remove(id string)
- func (t *InMemoryTreeStorage) Root() (*treechangeproto.RawTreeChangeWithId, error)
- func (t *InMemoryTreeStorage) SetHeads(heads []string) error
- func (t *InMemoryTreeStorage) SetReturnErrorOnAdd(err error)
- type TreeStorage
- type TreeStorageCreatePayload
- type TreeStorageCreatorFunc
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func CreateHeadsPayload ¶
func JoinStringsToBytes ¶
func ParseHeads ¶
Types ¶
type Exporter ¶
type Exporter interface {
TreeStorage(root *treechangeproto.RawTreeChangeWithId) (TreeStorage, error)
}
type InMemoryTreeStorage ¶
type InMemoryTreeStorage struct { Changes map[string]*treechangeproto.RawTreeChangeWithId sync.Mutex // contains filtered or unexported fields }
func (*InMemoryTreeStorage) AddRawChange ¶
func (t *InMemoryTreeStorage) AddRawChange(change *treechangeproto.RawTreeChangeWithId) error
func (*InMemoryTreeStorage) AddRawChangesSetHeads ¶
func (t *InMemoryTreeStorage) AddRawChangesSetHeads(changes []*treechangeproto.RawTreeChangeWithId, heads []string) error
func (*InMemoryTreeStorage) AllChanges ¶ added in v0.3.2
func (t *InMemoryTreeStorage) AllChanges() []*treechangeproto.RawTreeChangeWithId
func (*InMemoryTreeStorage) Copy ¶
func (t *InMemoryTreeStorage) Copy() *InMemoryTreeStorage
func (*InMemoryTreeStorage) Delete ¶
func (t *InMemoryTreeStorage) Delete() error
func (*InMemoryTreeStorage) Equal ¶
func (t *InMemoryTreeStorage) Equal(other *InMemoryTreeStorage) bool
func (*InMemoryTreeStorage) GetAllChangeIds ¶ added in v0.5.0
func (t *InMemoryTreeStorage) GetAllChangeIds() (chs []string, err error)
func (*InMemoryTreeStorage) GetAppendRawChange ¶ added in v0.5.0
func (t *InMemoryTreeStorage) GetAppendRawChange(ctx context.Context, buf []byte, id string) (*treechangeproto.RawTreeChangeWithId, error)
func (*InMemoryTreeStorage) GetRawChange ¶
func (t *InMemoryTreeStorage) GetRawChange(ctx context.Context, changeId string) (*treechangeproto.RawTreeChangeWithId, error)
func (*InMemoryTreeStorage) Heads ¶
func (t *InMemoryTreeStorage) Heads() ([]string, error)
func (*InMemoryTreeStorage) Id ¶
func (t *InMemoryTreeStorage) Id() string
func (*InMemoryTreeStorage) Remove ¶ added in v0.5.0
func (t *InMemoryTreeStorage) Remove(id string)
func (*InMemoryTreeStorage) Root ¶
func (t *InMemoryTreeStorage) Root() (*treechangeproto.RawTreeChangeWithId, error)
func (*InMemoryTreeStorage) SetHeads ¶
func (t *InMemoryTreeStorage) SetHeads(heads []string) error
func (*InMemoryTreeStorage) SetReturnErrorOnAdd ¶
func (t *InMemoryTreeStorage) SetReturnErrorOnAdd(err error)
type TreeStorage ¶
type TreeStorage interface { Id() string Root() (*treechangeproto.RawTreeChangeWithId, error) Heads() ([]string, error) SetHeads(heads []string) error AddRawChange(change *treechangeproto.RawTreeChangeWithId) error AddRawChangesSetHeads(changes []*treechangeproto.RawTreeChangeWithId, heads []string) error GetAllChangeIds() ([]string, error) GetRawChange(ctx context.Context, id string) (*treechangeproto.RawTreeChangeWithId, error) GetAppendRawChange(ctx context.Context, buf []byte, id string) (*treechangeproto.RawTreeChangeWithId, error) HasChange(ctx context.Context, id string) (bool, error) Delete() error }
func NewInMemoryTreeStorage ¶
func NewInMemoryTreeStorage( root *treechangeproto.RawTreeChangeWithId, heads []string, changes []*treechangeproto.RawTreeChangeWithId) (TreeStorage, error)
type TreeStorageCreatePayload ¶
type TreeStorageCreatePayload struct { RootRawChange *treechangeproto.RawTreeChangeWithId Changes []*treechangeproto.RawTreeChangeWithId Heads []string }
type TreeStorageCreatorFunc ¶
type TreeStorageCreatorFunc = func(payload TreeStorageCreatePayload) (TreeStorage, error)
Directories ¶
Path | Synopsis |
---|---|
Package mock_treestorage is a generated GoMock package.
|
Package mock_treestorage is a generated GoMock package. |
Click to show internal directories.
Click to hide internal directories.