model

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConsumableStorePathTypeDescriptor = iota
	ConsumableStorePathTypeFileList
)
View Source
const (
	CurrentBundleVersion = 1
)

Variables

This section is empty.

Functions

func BytesToInt64

func BytesToInt64(b []byte) int64

func BytesToUint64

func BytesToUint64(b []byte) uint64

func GetArchivePathPrefixToBundles

func GetArchivePathPrefixToBundles(repo string) string

func GetArchivePathPrefixToLabels

func GetArchivePathPrefixToLabels(repo string, prefixes ...string) string

func GetArchivePathPrefixToRepos

func GetArchivePathPrefixToRepos() string

func GetArchivePathToBundle

func GetArchivePathToBundle(repo string, bundleID string) string

func GetArchivePathToBundleFileList

func GetArchivePathToBundleFileList(repo string, bundleID string, index uint64) string

func GetArchivePathToLabel

func GetArchivePathToLabel(repo string, labelName string) string

func GetArchivePathToRepoDescriptor

func GetArchivePathToRepoDescriptor(repo string) string

GetArchivePathToRepoDescriptor returns the path for a repo descriptor

func GetBundleTimeStamp

func GetBundleTimeStamp() time.Time

func GetConsumablePathToBundle

func GetConsumablePathToBundle(bundleID string) string

func GetConsumablePathToBundleFileList

func GetConsumablePathToBundleFileList(bundleID string, index uint64) string

func Int64ToBytes

func Int64ToBytes(u *int64) []byte

func IsGeneratedFile

func IsGeneratedFile(file string) bool

func Uint64ToBytes

func Uint64ToBytes(u *uint64) []byte

func UnsafeBytesToString

func UnsafeBytesToString(b []byte) string

UnsafeBytesToString converts []byte to string without a memcopy

func UnsafeStringToBytes

func UnsafeStringToBytes(s string) []byte

UnsafeStringToBytes converts strings to []byte without memcopy

func Validate

func Validate(repo RepoDescriptor) error

Types

type ArchivePathComponents

type ArchivePathComponents struct {
	Repo            string
	BundleID        string
	ArchiveFileName string
	LabelName       string
}

func GetArchivePathComponents

func GetArchivePathComponents(archivePath string) (ArchivePathComponents, error)

this function's design is converging on being able to return something meaningful * given any path in the metadata archive, not just those corresponding to bundles. * * the return value might be changed to an interface type in later iterations.

type BundleDescriptor

type BundleDescriptor struct {
	LeafSize               uint32        `json:"leafSize" yaml:"leafSize"` // Each bundles blobs are independently generated
	ID                     string        `json:"id" yaml:"id"`
	Message                string        `json:"message" yaml:"message"`
	Parents                []string      `json:"parents,omitempty" yaml:"parents,omitempty"`
	Timestamp              time.Time     `json:"timestamp,omitempty" yaml:"timestamp,omitempty"`
	Contributors           []Contributor `json:"contributors" yaml:"contributors"`
	BundleEntriesFileCount uint64        `json:"count" yaml:"count"`                         // Number of files which have BundleDescriptor Entries
	Version                uint64        `json:"version,omitempty" yaml:"version,omitempty"` // Version for the bundle
	// contains filtered or unexported fields
}

BundleDescriptor represents a commit which is a file tree with the changes to the repository.

type BundleDescriptors

type BundleDescriptors []BundleDescriptor

BundleDescriptors is a sortable slice of BundleDescriptor

func (BundleDescriptors) Last

func (BundleDescriptors) Len

func (b BundleDescriptors) Len() int

func (BundleDescriptors) Less

func (b BundleDescriptors) Less(i, j int) bool

func (BundleDescriptors) Swap

func (b BundleDescriptors) Swap(i, j int)

type BundleEntries

type BundleEntries struct {
	BundleEntries []BundleEntry `json:"BundleEntries" yaml:"BundleEntries"`
	// contains filtered or unexported fields
}

List of files part of a bundle.

type BundleEntry

type BundleEntry struct {
	Hash         string      `json:"hash" yaml:"hash"`
	NameWithPath string      `json:"name" yaml:"name"`
	FileMode     os.FileMode `json:"mode" yaml:"mode"`
	Size         uint64      `json:"size" yaml:"size"`
	// contains filtered or unexported fields
}

List of files, directories (empty) skipped

type ConsumableStorePathMetadata

type ConsumableStorePathMetadata struct {
	Type     byte
	BundleID string
	Index    uint64
}

func GetConsumableStorePathMetadata

func GetConsumableStorePathMetadata(path string) (ConsumableStorePathMetadata, error)

*

  • this function is the inverse of GetConsumablePath* functions.
  • the GetConsumablePath* functions return bundle.ConsumableStore keys (paths)
  • given some parameters from the bundle.
  • this function, given one of the paths returned by a GetConsumablePath* function,
  • parses the path and returns the input values to that function.

type ConsumableStorePathMetadataErr

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

func (ConsumableStorePathMetadataErr) Error

type Contributor

type Contributor struct {
	Name  string `json:"name" yaml:"name"`
	Email string `json:"email" yaml:"email"`
	// contains filtered or unexported fields
}

Contributor who created the object

func (*Contributor) String

func (c *Contributor) String() string

type LabelDescriptor

type LabelDescriptor struct {
	Name         string        `json:"name,omitempty" yaml:"name,omitempty"`
	BundleID     string        `json:"id" yaml:"id"`
	Timestamp    time.Time     `json:"timestamp,omitempty" yaml:"timestamp,omitempty"`
	Contributors []Contributor `json:"contributors" yaml:"contributors"`
	// contains filtered or unexported fields
}

type LabelDescriptors

type LabelDescriptors []LabelDescriptor

LabelDescriptors is a sortable slice of LabelDescriptor

func (LabelDescriptors) Last

func (LabelDescriptors) Len

func (b LabelDescriptors) Len() int

func (LabelDescriptors) Less

func (b LabelDescriptors) Less(i, j int) bool

func (LabelDescriptors) Swap

func (b LabelDescriptors) Swap(i, j int)

type RepoDescriptor

type RepoDescriptor struct {
	Name        string      `json:"name,omitempty" yaml:"name,omitempty"`
	Description string      `json:"description,omitempty" yaml:"description,omitempty"`
	Timestamp   time.Time   `json:"timestamp,omitempty" yaml:"timestamp,omitempty"`
	Contributor Contributor `json:"contributor,omitempty" yaml:"contributor,omitempty"`
}

RepoDescriptor represents a commit which is a file tree with the changes to the repository.

type RepoDescriptors

type RepoDescriptors []RepoDescriptor

RepoDescriptors is a sortable slice of RepoDescriptor

func (RepoDescriptors) Last

Last return the last entry in a slice of RepoDescriptors

func (RepoDescriptors) Len

func (b RepoDescriptors) Len() int

func (RepoDescriptors) Less

func (b RepoDescriptors) Less(i, j int) bool

func (RepoDescriptors) Swap

func (b RepoDescriptors) Swap(i, j int)

Jump to

Keyboard shortcuts

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