versionhistory

package
v1.25.0-114.2 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2024 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 CompareVersionHistory added in v1.23.0

func CompareVersionHistory(v1 *historyspb.VersionHistory, v2 *historyspb.VersionHistory) (int, error)

CompareVersionHistory compares 2 version history items

func CompareVersionHistoryItem added in v1.23.0

func CompareVersionHistoryItem(item1 *historyspb.VersionHistoryItem, item2 *historyspb.VersionHistoryItem) int

CompareVersionHistoryItem compares 2 version history items

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 FindLCAVersionHistoryItemFromItemSlice added in v1.23.0

func FindLCAVersionHistoryItemFromItemSlice(versionHistoryItemsA []*historyspb.VersionHistoryItem, versionHistoryItemsB []*historyspb.VersionHistoryItem) (*historyspb.VersionHistoryItem, error)

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 IsEqualVersionHistoryItems added in v1.23.0

func IsEqualVersionHistoryItems(items1 []*historyspb.VersionHistoryItem, items2 []*historyspb.VersionHistoryItem) bool

IsEqualVersionHistoryItems 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 IsVersionHistoryItemsInSameBranch added in v1.23.0

func IsVersionHistoryItemsInSameBranch(versionHistoryItemsA []*historyspb.VersionHistoryItem, versionHistoryItemsB []*historyspb.VersionHistoryItem) bool

IsVersionHistoryItemsInSameBranch checks if two version history items are in the same branch

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.

func SplitVersionHistoryByLastLocalGeneratedItem added in v1.24.0

func SplitVersionHistoryByLastLocalGeneratedItem(
	versionHistoryItems []*historyspb.VersionHistoryItem,
	initialFailoverVersion int64,
	failoverVersionIncrement int64,
) (localItems []*historyspb.VersionHistoryItem, remoteItems []*historyspb.VersionHistoryItem)

Types

This section is empty.

Jump to

Keyboard shortcuts

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