Documentation ¶
Index ¶
- Constants
- Variables
- type Blob
- type BlobRef
- type Client
- type Collection
- type CollectionChangeset
- type Config
- type Directory
- type File
- type IntegrityVerificationJob
- type KeyEncryptionKey
- type KeyEnvelope
- type KeySlot
- type Node
- type ReplicationPolicy
- type ScheduledJob
- type ScheduledJobLastRun
- type Volume
- type VolumeMount
Constants ¶
View Source
const ( BlobSize = 4 * mebibyte NoParentId = "" )
Variables ¶
View Source
var (
ErrBlobNotAccessibleOnThisNode = errors.New("blob not accessible on this node")
)
Functions ¶
This section is empty.
Types ¶
type Blob ¶
type Blob struct { Ref BlobRef EncryptionKeyId string Volumes []int VolumesPendingReplication []int Referenced bool // aborted uploads (ones that do not get referenced by a commit) could leave orphaned blobs IsCompressed bool Size int32 // 32 bits is enough, usually blobs are 4 MB SizeOnDisk int32 // after optional compression Crc32 []byte }
type BlobRef ¶
type BlobRef []byte
func BlobRefFromBytes ¶
func BlobRefFromHex ¶
func (*BlobRef) AsSha256Sum ¶
type Collection ¶
type Collection struct { ID string Created time.Time // earliest of all changesets' file create/update timestamps Directory string Name string Description string Sensitivity int // 0(for all eyes) 1(a bit sensitive) 2(for my eyes only) ReplicationPolicy string // [calculated] effective policy inherited from parent directory Head string // points to the head changeset. unset only for empty collections EncryptionKeys []KeyEnvelope // first is for all new blobs, the following for moved/deduplicated ones Changesets []CollectionChangeset Metadata map[string]string Rating int // 1-5 Tags []string GlobalVersion uint64 `msgpack:"gv"` }
func (*Collection) BumpGlobalVersion ¶
func (c *Collection) BumpGlobalVersion()
this implementation is really bad as a global ordering number (time synchronization issues between servers, time jumping back and forth..), but this is temporary until we're migrating to EventHorizon which gives us change feeds in a much better way.
type CollectionChangeset ¶
type CollectionChangeset struct { ID string Parent string Created time.Time FilesCreated []File FilesUpdated []File FilesDeleted []string }
func NewChangeset ¶
func (*CollectionChangeset) AnyChanges ¶
func (c *CollectionChangeset) AnyChanges() bool
type Directory ¶
type Directory struct { ID string Created time.Time MetaCollection string // backing collection for directory's metadata Parent string Name string Type string Sensitivity int // 0(for all eyes) 1(a bit sensitive) 2(for my eyes only) ReplicationPolicy string // explicit (for collections it is calculated) Deprecated1 map[string]string `msgpack:"Metadata" json:"Metadata"` Deprecated2 string `msgpack:"Description" json:"Description"` }
type File ¶
type File struct { Path string Sha256 string Created time.Time Modified time.Time Size int64 BlobRefs []string // TODO: use explicit datatype? }
func (*File) CopyEverythingExceptPath ¶
type KeyEncryptionKey ¶
type KeyEnvelope ¶
func FindDekEnvelope ¶
func FindDekEnvelope(keyId string, kenvs []KeyEnvelope) *KeyEnvelope
type Node ¶
type Node struct { ID string Addr string Name string TlsCert string SmartBackend stoservertypes.SmartBackend }
type ReplicationPolicy ¶
type ReplicationPolicy struct { ID string Name string DesiredVolumes []int // where the policy currently directs data (TODO: rename to CurrentVolumes?) MinZones int // if >= 2, then data is considered fire etc. disaster safe }
func (*ReplicationPolicy) ReplicaCount ¶
func (r *ReplicationPolicy) ReplicaCount() int
type ScheduledJob ¶
type ScheduledJob struct { ID string Kind stoservertypes.ScheduledJobKind Description string Schedule string Enabled bool NextRun time.Time LastRun *ScheduledJobLastRun }
type ScheduledJobLastRun ¶
func (ScheduledJobLastRun) Runtime ¶
func (s ScheduledJobLastRun) Runtime() time.Duration
type Volume ¶
type Volume struct { ID int UUID string Label string Description string Notes string SerialNumber string Technology string SmartId string SmartReport string Zone string Enclosure string EnclosureSlot int // 0 = not defined Manufactured time.Time WarrantyEnds time.Time Quota int64 BlobSizeTotal int64 // @ compressed & deduplicated BlobCount int64 // does not include queued writes or volume descriptor blob (sha256=0000..) Decommissioned *time.Time DecommissionReason string }
type VolumeMount ¶
type VolumeMount struct { ID string Volume int Node string Driver stoservertypes.VolumeDriverKind DriverOpts string }
Click to show internal directories.
Click to hide internal directories.