bucket

package
v0.0.0-...-4a74ca9 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2022 License: MPL-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Ok int = iota << 1
	Err
)
View Source
const API_KEY_SIA = "wizStorage"
View Source
const APP_VENDOR_CODE = "Sia-Agent"
View Source
const COLLECTION_NAME string = "ContentAddress"

Variables

View Source
var Composite string = ""
View Source
var Key string = ""

Functions

func GetClient

func GetClient() *firestore.Client

func GetContent

func GetContent() string

content address have another operation "Get"

func NewObject

func NewObject(i DBStorage)

replicate copy of bucket

func SetClient

func SetClient(c *firestore.Client)

func SetContent

func SetContent(link string)

content address is an machine generated address for a particular content. This is similarly to public key but the key is 32bit long. "Set" will hold new link

Types

type Bucket_Service

type Bucket_Service interface {
	New_Bucket(o *proto.Object) *proto.IObject
	Preview(query *proto.Query) *proto.QState
	Download(query *proto.Query) *proto.QState
}

func New_Client

func New_Client(ctx *context.Context) Bucket_Service

type DBStorage

type DBStorage interface {
	Store(context.Context, *firestore.Client) int
	Get(context.Context, *firestore.Client) (interface{}, int)
}

func GetObject

func GetObject() DBStorage

return copy of bucket

func New

func New(key, value, composite string) DBStorage

type DBStore

type DBStore struct {
	Key       string
	Composite string
	Value     string
}

func (*DBStore) Get

func (db *DBStore) Get(ctx context.Context, client *firestore.Client) (interface{}, int)

func (*DBStore) Store

func (db *DBStore) Store(ctx context.Context, client *firestore.Client) int

type GBucket

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

func (*GBucket) Download

func (c *GBucket) Download(query *proto.Query) *proto.QState

"Download" function allow user to download document file on your local machine

func (*GBucket) New_Bucket

func (c *GBucket) New_Bucket(o *proto.Object) *proto.IObject

func (*GBucket) Preview

func (c *GBucket) Preview(query *proto.Query) *proto.QState

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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