data

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2021 License: GPL-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package data contains TreeHub data object and their methods

Index

Constants

View Source
const ErrorDataSerializationObjectID = apperrors.ErrorDataSerialization + ":ObjectID"

ErrorDataSerializationObjectID is error of data.ObjectID serialization

Variables

This section is empty.

Functions

This section is empty.

Types

type Commit

type Commit string

Commit is OTSTree commit object

func NewCommit

func NewCommit(str string) (Commit, error)

NewCommit validate str and create Commit object

func NewCommitFromBytes

func NewCommitFromBytes(content []byte) (Commit, error)

NewCommitFromBytes validate content and create Commit object

func (Commit) From

func (obj Commit) From() (ObjectID, error)

From converts Commit to ObjectID

func (Commit) Validate

func (obj Commit) Validate() error

Validate if Commit has valid format

type CommitManifest

type CommitManifest struct {
	Namespace Namespace
	Commit    ObjectID
	Contents  string
}

CommitManifest is OSTree commit manifest

type DeltaID

type DeltaID string

DeltaID is OSTree delta

func (DeltaID) ToObjectID

func (delta DeltaID) ToObjectID() (ObjectID, error)

ToObjectID transforms DeltaID to ObjectID

func (DeltaID) URLSafe added in v0.0.9

func (delta DeltaID) URLSafe() string

URLSafe converts DeltaID string to url safe encoding

func (DeltaID) Validate

func (delta DeltaID) Validate() error

Validate if DeltaID has valid format

type Namespace

type Namespace string

Namespace is object namespace

func NewNamespace

func NewNamespace(id string) Namespace

NewNamespace creates namespace with random uuid

type Object

type Object struct {
	Namespace Namespace
	ID        ObjectID
	ByteSize  int64
	Status    ObjectStatus
}

Object OSTree object definition

type ObjectID

type ObjectID string

ObjectID is OSTree object identifier

func NewObjectID

func NewObjectID(str string) (ObjectID, error)

NewObjectID create new ObjectID if str is valid

func (ObjectID) Filename

func (objectId ObjectID) Filename() string

Filename returns file name of ObjectID in storage

func (ObjectID) Path

func (objectId ObjectID) Path(parent string) string

Path returns absolute path to ObjectID is storage

func (ObjectID) Validate

func (objectId ObjectID) Validate() error

Validate if ObjectId has valid format

type ObjectStatus

type ObjectStatus int

ObjectStatus is enumeration of possible object states

const (
	// Uploaded means data.Object was successfully uploaded to server
	Uploaded ObjectStatus = iota
	// ServerUploading means data.Object was created, but content not fully uploaded to the server
	ServerUploading
)

type Ref

type Ref struct {
	Namespace Namespace
	Name      RefName
	Value     Commit
	ObjectID  ObjectID
}

Ref is OSTree object reference

func NewRef

func NewRef(ns Namespace, refName RefName, value Commit) (Ref, error)

NewRef create new instance of Ref

func (Ref) Validate

func (ref Ref) Validate() error

Validate doing validation of Ref

type RefName

type RefName string

RefName is name of OSTree Ref

Jump to

Keyboard shortcuts

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