iversion_control

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ZeroVersion = Version(time.Time{})

Functions

func Sign

func Sign(data interface{}) (string, error)

func Version

func Version(t time.Time) string

Types

type ConfigGenerator

type ConfigGenerator func(ctx context.Context) (*ExportData, error)

type ExportData

type ExportData struct {
	Topic              string
	DataWithoutVersion VersionValuable

	DataSignWithoutVersion string
	// contains filtered or unexported fields
}

func (*ExportData) CalculateVersion

func (cs *ExportData) CalculateVersion() (string, error)

func (*ExportData) Version

func (cs *ExportData) Version() string

type VersionControlManager

type VersionControlManager struct {
	// contains filtered or unexported fields
}

func NewVersionControllerManager

func NewVersionControllerManager(txn itxn.TxnStorager, storager VersionControlStorager) *VersionControlManager

func (*VersionControlManager) ExportConfig

func (vcm *VersionControlManager) ExportConfig(ctx context.Context, configTopic string,
	generaotr ConfigGenerator) (lrv *ExportData, err error)

type VersionControlStorager

type VersionControlStorager interface {

	// UpsertConfigLastExportedVersion will got last export data
	// if config changed, create new version and return
	// if not, return last version
	UpsertConfigLastExportedVersion(ctx context.Context, css *ExportData) (string, error)
}

type VersionValuable

type VersionValuable interface {
	UpdateVersion(version string) error
}

Jump to

Keyboard shortcuts

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