Documentation
¶
Overview ¶
Package drivers abstracts different object storages, such as local, s3
Index ¶
Constants ¶
const S3_POLICY_EXPIRE_IN_HOURS = 24
S3_POLICY_EXPIRE_IN_HOURS how long access rights given to other node will be valid
Variables ¶
var GSBUCKET string
var S3BUCKET string
S3BUCKET s3 bucket owned by this node
Functions ¶
func GetSegmentData ¶
func IsOwnExternal ¶
func IsOwnStorageGS ¶
IsOwnStorageGS returns true if uri points to Google Cloud Storage bucket owned by this node
func IsOwnStorageS3 ¶
IsOwnStorageS3 returns true if uri points to S3 bucket owned by this node
Types ¶
type MemoryOS ¶
type MemoryOS struct {
// contains filtered or unexported fields
}
func NewMemoryDriver ¶
func (*MemoryOS) GetSession ¶
func (ostore *MemoryOS) GetSession(path string) *MemorySession
func (*MemoryOS) NewSession ¶
type MemorySession ¶
type MemorySession struct {
// contains filtered or unexported fields
}
func (*MemorySession) EndSession ¶
func (ostore *MemorySession) EndSession()
EndSession clears memory cache
func (*MemorySession) GetData ¶
func (ostore *MemorySession) GetData(name string) []byte
GetData returns the cached data for a name.
A name can be an absolute or relative URI. An absolute URI has the following format: - ostore.os.baseURI + /stream/ + ostore.path + path + file The following are valid relative URIs: - /stream/ + ostore.path + path + file (if ostore.os.baseURI is empty) - ostore.path + path + file
func (*MemorySession) GetInfo ¶
func (ostore *MemorySession) GetInfo() *net.OSInfo
func (*MemorySession) IsExternal ¶
func (ostore *MemorySession) IsExternal() bool
type OSDriver ¶
OSDriver common interface for Object Storage
var NodeStorage OSDriver
NodeStorage is current node's primary driver
func NewGoogleDriver ¶
func NewS3Driver ¶
type OSSession ¶
type OSSession interface {
SaveData(name string, data []byte) (string, error)
EndSession()
// Info in order to have this session used via RPC
GetInfo() *net.OSInfo
// Indicates whether data may be external to this node
IsExternal() bool
}
func NewSession ¶
NewSession returns new session based on OSInfo received from the network