versionhistory

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2021 License: MIT Imports: 4 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddOrUpdateVersionHistoryItem

func AddOrUpdateVersionHistoryItem(v *historyspb.VersionHistory, item *historyspb.VersionHistoryItem) error

AddOrUpdateVersionHistoryItem updates the VersionHistory with new VersionHistoryItem.

func AddVersionHistory

func AddVersionHistory(h *historyspb.VersionHistories, v *historyspb.VersionHistory) (bool, int32, error)

AddVersionHistory adds a VersionHistory and return the whether current branch is changed.

func ContainsVersionHistoryItem

func ContainsVersionHistoryItem(v *historyspb.VersionHistory, item *historyspb.VersionHistoryItem) bool

ContainsVersionHistoryItem check whether VersionHistory has given VersionHistoryItem.

func CopyVersionHistories

func CopyVersionHistories(h *historyspb.VersionHistories) *historyspb.VersionHistories

Copy VersionHistories.

func CopyVersionHistory

func CopyVersionHistory(v *historyspb.VersionHistory) *historyspb.VersionHistory

CopyVersionHistory copies VersionHistory.

func CopyVersionHistoryItem added in v1.4.0

func CopyVersionHistoryItem(item *historyspb.VersionHistoryItem) *historyspb.VersionHistoryItem

CopyVersionHistoryItem create a new instance of VersionHistoryItem.

func CopyVersionHistoryUntilLCAVersionHistoryItem

func CopyVersionHistoryUntilLCAVersionHistoryItem(v *historyspb.VersionHistory, lcaItem *historyspb.VersionHistoryItem) (*historyspb.VersionHistory, error)

CopyVersionHistoryUntilLCAVersionHistoryItem returns copy of VersionHistory up until LCA item.

func FindFirstVersionHistoryIndexByVersionHistoryItem

func FindFirstVersionHistoryIndexByVersionHistoryItem(h *historyspb.VersionHistories, item *historyspb.VersionHistoryItem) (int32, error)

FindFirstVersionHistoryIndexByVersionHistoryItem find the first VersionHistory index which contains the given version history item.

func FindLCAVersionHistoryItem

func FindLCAVersionHistoryItem(v *historyspb.VersionHistory, remote *historyspb.VersionHistory) (*historyspb.VersionHistoryItem, error)

FindLCAVersionHistoryItem returns the lowest common ancestor VersionHistoryItem.

func FindLCAVersionHistoryItemAndIndex

func FindLCAVersionHistoryItemAndIndex(h *historyspb.VersionHistories, incomingHistory *historyspb.VersionHistory) (*historyspb.VersionHistoryItem, int32, error)

FindLCAVersionHistoryItemAndIndex finds the lowest common ancestor VersionHistory index and corresponding item.

func GetCurrentVersionHistory

func GetCurrentVersionHistory(h *historyspb.VersionHistories) (*historyspb.VersionHistory, error)

GetCurrentVersionHistory gets the current VersionHistory.

func GetFirstVersionHistoryItem

func GetFirstVersionHistoryItem(v *historyspb.VersionHistory) (*historyspb.VersionHistoryItem, error)

GetFirstVersionHistoryItem return the first VersionHistoryItem.

func GetLastVersionHistoryItem

func GetLastVersionHistoryItem(v *historyspb.VersionHistory) (*historyspb.VersionHistoryItem, error)

GetLastVersionHistoryItem return the last VersionHistoryItem.

func GetVersionHistory

func GetVersionHistory(h *historyspb.VersionHistories, index int32) (*historyspb.VersionHistory, error)

GetVersionHistory gets the VersionHistory according to index provided.

func GetVersionHistoryEventVersion

func GetVersionHistoryEventVersion(v *historyspb.VersionHistory, eventID int64) (int64, error)

GetVersionHistoryEventVersion return the corresponding event version of an event ID.

func IsEmptyVersionHistory

func IsEmptyVersionHistory(v *historyspb.VersionHistory) bool

IsEmptyVersionHistory indicate whether version history is empty

func IsEqualVersionHistoryItem added in v1.4.0

func IsEqualVersionHistoryItem(item1 *historyspb.VersionHistoryItem, item2 *historyspb.VersionHistoryItem) bool

IsEqualVersionHistoryItem checks whether version history items are equal

func IsLCAVersionHistoryItemAppendable

func IsLCAVersionHistoryItemAppendable(v *historyspb.VersionHistory, lcaItem *historyspb.VersionHistoryItem) bool

IsLCAVersionHistoryItemAppendable checks if a LCA VersionHistoryItem is appendable.

func IsVersionHistoriesRebuilt

func IsVersionHistoriesRebuilt(h *historyspb.VersionHistories) (bool, error)

IsVersionHistoriesRebuilt returns true if the current branch index's last write version is not the largest among all branches' last write version.

func NewVersionHistories

func NewVersionHistories(versionHistory *historyspb.VersionHistory) *historyspb.VersionHistories

NewVersionHistories create a new instance of VersionHistories.

func NewVersionHistory

func NewVersionHistory(branchToken []byte, items []*historyspb.VersionHistoryItem) *historyspb.VersionHistory

NewVersionHistory create a new instance of VersionHistory.

func NewVersionHistoryItem

func NewVersionHistoryItem(eventID int64, version int64) *historyspb.VersionHistoryItem

NewVersionHistoryItem create a new instance of VersionHistoryItem.

func SetCurrentVersionHistoryIndex

func SetCurrentVersionHistoryIndex(h *historyspb.VersionHistories, currentVersionHistoryIndex int32) error

SetCurrentVersionHistoryIndex set the current VersionHistory index.

func SetVersionHistoryBranchToken

func SetVersionHistoryBranchToken(v *historyspb.VersionHistory, branchToken []byte)

SetVersionHistoryBranchToken sets the branch token.

Types

This section is empty.

Jump to

Keyboard shortcuts

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