edgex

package
v0.0.0-...-ded4e1a Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2020 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const BYTE_BUFFER int = 16 * 1024
View Source
const CCOW_O_CREATE int = 0x02
View Source
const CCOW_O_REPLACE int = 0x01
View Source
const DEFAULT_BTREE_ORDER int = 4
View Source
const DEFAULT_CHUNKSIZE int = 4096
View Source
const GVMR_LOCKED int = 1
View Source
const GVMR_UNLOCKED int = 0
View Source
const OBJECT_TYPE_KEY_VALUE = "keyValue"
View Source
const OBJECT_TYPE_OBJECT = "object"
View Source
const SS_APPEND int = 0x02
View Source
const SS_CONT int = 0x00
View Source
const SS_FIN int = 0x01
View Source
const SS_KV int = 0x08
View Source
const SS_RANDWR int = 0x04
View Source
const SS_STAT int = 0x10

Variables

This section is empty.

Functions

func ArrToCVS

func ArrToCVS(arr ...string) string

ArrToCVS - convert k/v pairs to cvs

func ArrToJSON

func ArrToJSON(arr ...string) string

ArrToJSON - convert k/v pairs to json

func GVMRPrint

func GVMRPrint(head string, g GVMR)

GVMRPrint - print GVMR record

func GVMRToCSV

func GVMRToCSV(gvm GVMR) string

GVMRToCSV - convert GVMR parameters to cvs

func GlobalGetPrepare

func GlobalGetPrepare(opath string) error

func GlobalGetPrepareInternal

func GlobalGetPrepareInternal(gvm GVMR) error

func GlobalVMAcquire

func GlobalVMAcquire(opath string) error

GlobalVMAcquire - aquire global VM record lock

func GlobalVMRelease

func GlobalVMRelease(opath string) error

GlobalVMRelease - release global VM record lock

func ObjectGetLocalHeaders

func ObjectGetLocalHeaders(opath string, gvm *GVMR) error

func SetupS3xClient

func SetupS3xClient(obj string) (S3xClient, EdgexTest)

SetupS3xClient - setup S3xClient from configuration file

Types

type Bucket

type Bucket struct {
	XMLName      xml.Name `xml:"Bucket"`
	CreationDate string   `xml:"CreationDate"`
	Name         string   `xml:"Name"`
}

Bucket structure

type Buckets

type Buckets struct {
	XMLName xml.Name `xml:"Buckets"`
	Buckets []Bucket `xml:"Bucket"`
}

Buckets - array of Buckets

type Edgex

type Edgex struct {
	Url string

	// s3 authentication keys
	Authkey string
	Secret  string

	// Current session
	Bucket string
	Object string
	Sid    string
	Debug  int
}

Edgex - Edgex client structure

func CreateEdgex

func CreateEdgex(url, authkey, secret string, debug int) *Edgex

CreateEdgex - client structure constructorcd

func (*Edgex) BucketCreate

func (edgex *Edgex) BucketCreate(bucket string) error

BucketCreate - create a new bucket

func (*Edgex) BucketDelete

func (edgex *Edgex) BucketDelete(bucket string) error

BucketDelete - delete bucket

func (*Edgex) BucketHead

func (edgex *Edgex) BucketHead(bucket string) error

BucketHead - read bucket header fields

func (*Edgex) BucketList

func (edgex *Edgex) BucketList() ([]Bucket, error)

BucketList - read bucket list

func (*Edgex) CloseEdgex

func (edgex *Edgex) CloseEdgex()

CloseEdgex - close client connection

func (*Edgex) KeyValueCommit

func (edgex *Edgex) KeyValueCommit(bucket string, object string) error

KeyValueCommit - commit key/value insert/update/delete

func (*Edgex) KeyValueDelete

func (edgex *Edgex) KeyValueDelete(bucket string, object string,
	key string, more bool) error

KeyValueDelete - delete key/value pair

func (*Edgex) KeyValueDeleteJSON

func (edgex *Edgex) KeyValueDeleteJSON(bucket string, object string,
	keyValueJSON string, more bool) error

KeyValueDeleteJSON - delete key/value pairs defined by json

func (*Edgex) KeyValueGet

func (edgex *Edgex) KeyValueGet(bucket string, object string, key string) (string, error)

KeyValueGet - read object value field

func (*Edgex) KeyValueGetInt

func (edgex *Edgex) KeyValueGetInt(bucket string, object string, key string) (string, int)

KeyValueGetInt - read object value field

func (*Edgex) KeyValueList

func (edgex *Edgex) KeyValueList(bucket string, object string,
	from string, pattern string, contentType string, maxcount int, values bool) (string, error)

KeyValueList - read key/value pairs, contentType: application/json or text/csv

func (*Edgex) KeyValuePost

func (edgex *Edgex) KeyValuePost(bucket string, object string, contentType string,
	key string, value *bytes.Buffer, more bool) error

KeyValuePost - post key/value pairs

func (*Edgex) KeyValuePostCSV

func (edgex *Edgex) KeyValuePostCSV(bucket string, object string,
	keyValueCSV string, more bool) error

KeyValuePostCSV - post key/value pairs presented like csv

func (*Edgex) KeyValuePostJSON

func (edgex *Edgex) KeyValuePostJSON(bucket string, object string,
	keyValueJSON string, more bool) error

KeyValuePostJSON - post key/value pairs

func (*Edgex) KeyValueRollback

func (edgex *Edgex) KeyValueRollback(bucket string, object string) error

KeyValueRollback - rollback key/value insert/update/delete session

func (*Edgex) ObjectCreate

func (edgex *Edgex) ObjectCreate(bucket string, object string, objectType string,
	contentType string, chunkSize int, btreeOrder int) error

ObjectCreate - create object

func (*Edgex) ObjectDelete

func (edgex *Edgex) ObjectDelete(bucket string, object string) error

ObjectDelete - delete object

func (*Edgex) ObjectHead

func (edgex *Edgex) ObjectHead(bucket string, object string) error

ObjectHead - read object header fields

func (*Edgex) ObjectList

func (edgex *Edgex) ObjectList(bucket string,
	from string, pattern string, maxcount int) ([]Object, error)

ObjectList - read object list from bucket

type EdgexTest

type EdgexTest struct {
	Mockup  int    `json:"mockup"`
	Url     string `json:"url"`
	Authkey string `json:"authkey"`
	Secret  string `json:"secret"`
	Bucket  string `json:"bucket"`
	Object  string `json:"object"`
	Debug   int    `json:"debug"`
}

EdgexTest - general Edgex client test structure

type GVMR

type GVMR struct {
	Path      string
	Genid     uint64
	Uvid      uint64
	Deleted   uint
	Nhid      string
	Vmchid    string
	Segid     uint64
	Size      uint64
	Locktime  int64
	Lockstate int
}

GVMR - general global VM structure

func GlobalVMGetInt

func GlobalVMGetInt(opath string) (GVMR, int)

GlobalVMGetInt - get global VM record

type ListAllMyBucketsResult

type ListAllMyBucketsResult struct {
	XMLName xml.Name `xml:"ListAllMyBucketsResult"`
	Buckets Buckets  `xml:"Buckets"`
}

ListAllMyBucketsResult - bucket list structure

type ListBucketResult

type ListBucketResult struct {
	XMLName xml.Name `xml:"ListBucketResult"`
	Objects []Object `xml:"Contents"`
}

ListBucketResult - bucket list structure

type Mockup

type Mockup struct {

	// Current session
	Bucket string
	Object string
	Sid    string
	Debug  int
	// contains filtered or unexported fields
}

Mockup - mockup client mockup structure

func CreateMockup

func CreateMockup(debug int) *Mockup

CreateMockup - client structure constructor

func (*Mockup) BucketCreate

func (mockup *Mockup) BucketCreate(bucket string) error

BucketCreate - create a new bucket

func (*Mockup) BucketDelete

func (mockup *Mockup) BucketDelete(bucket string) error

BucketDelete - delete bucket

func (*Mockup) BucketHead

func (mockup *Mockup) BucketHead(bucket string) error

BucketHead - read bucket header fields

func (*Mockup) BucketList

func (mockup *Mockup) BucketList() ([]Bucket, error)

BucketList - read bucket list

func (*Mockup) CloseEdgex

func (mockup *Mockup) CloseEdgex()

CloseEdgex - close client connection

func (*Mockup) KeyValueCommit

func (mockup *Mockup) KeyValueCommit(bucket string, object string) error

KeyValueCommit - commit key/value insert/update/delete

func (*Mockup) KeyValueDelete

func (mockup *Mockup) KeyValueDelete(bucket string, object string,
	key string, more bool) error

KeyValueDelete - delete key/value pair

func (*Mockup) KeyValueDeleteJSON

func (mockup *Mockup) KeyValueDeleteJSON(bucket string, object string,
	keyValueJSON string, more bool) error

KeyValueDeleteJSON - delete key/value pairs defined by json

func (*Mockup) KeyValueGet

func (mockup *Mockup) KeyValueGet(bucket string, object string, key string) (string, error)

KeyValueGet - read object value field

func (*Mockup) KeyValueGetInt

func (mockup *Mockup) KeyValueGetInt(bucket string, object string, key string) (string, int)

KeyValueGetInt - read object value field

func (*Mockup) KeyValueList

func (mockup *Mockup) KeyValueList(bucket string, object string,
	from string, pattern string, contentType string, maxcount int, values bool) (string, error)

KeyValueList - read key/value pairs, contentType: application/json or text/csv

func (*Mockup) KeyValuePost

func (mockup *Mockup) KeyValuePost(bucket string, object string, contentType string,
	key string, value *bytes.Buffer, more bool) error

KeyValuePost - post key/value pairs

func (*Mockup) KeyValuePostCSV

func (mockup *Mockup) KeyValuePostCSV(bucket string, object string,
	keyValueCSV string, more bool) error

KeyValuePostCSV - post key/value pairs presented like csv

func (*Mockup) KeyValuePostJSON

func (mockup *Mockup) KeyValuePostJSON(bucket string, object string,
	keyValueJSON string, more bool) error

KeyValuePostJSON - post key/value pairs

func (*Mockup) KeyValueRollback

func (mockup *Mockup) KeyValueRollback(bucket string, object string) error

KeyValueRollback - rollback key/value insert/update/delete session

func (*Mockup) ObjectCreate

func (mockup *Mockup) ObjectCreate(bucket string, object string, objectType string,
	contentType string, chunkSize int, btreeOrder int) error

ObjectCreate - create object

func (*Mockup) ObjectDelete

func (mockup *Mockup) ObjectDelete(bucket string, object string) error

ObjectDelete - delete object

func (*Mockup) ObjectHead

func (mockup *Mockup) ObjectHead(bucket string, object string) error

ObjectHead - read object header fields

func (*Mockup) ObjectList

func (mockup *Mockup) ObjectList(bucket string,
	from string, pattern string, maxcount int) ([]Object, error)

ObjectList - read object list from bucket

type Object

type Object struct {
	XMLName      xml.Name `xml:"Contents"`
	Key          string   `xml:"Key"`
	LastModified string   `xml:"LastModified"`
	Size         int      `xml:"Size"`
}

Object - object structure

type S3xClient

type S3xClient interface {
	CloseEdgex()
	BucketCreate(bucket string) error
	BucketHead(bucket string) error
	BucketDelete(bucket string) error

	ObjectCreate(bucket string, object string, objectType string,
		contentType string, chunkSize int, btreeOrder int) error
	KeyValuePost(bucket string, object string, contentType string,
		key string, value *bytes.Buffer, more bool) error
	KeyValuePostJSON(bucket string, object string,
		keyValueJSON string, more bool) error
	KeyValuePostCSV(bucket string, object string,
		keyValueCSV string, more bool) error
	KeyValueDelete(bucket string, object string,
		key string, more bool) error
	KeyValueDeleteJSON(bucket string, object string,
		keyValueJSON string, more bool) error
	KeyValueCommit(bucket string, object string) error
	KeyValueRollback(bucket string, object string) error
	KeyValueGet(bucket string, object string, key string) (string, error)
	KeyValueGetInt(bucket string, object string, key string) (string, int)
	KeyValueList(bucket string, object string,
		from string, pattern string, contentType string, maxcount int, values bool) (string, error)
	ObjectHead(bucket string, object string) error
	ObjectDelete(bucket string, object string) error
	BucketList() ([]Bucket, error)
	ObjectList(bucket string, from string, pattern string, maxcount int) ([]Object, error)
}

S3xClient - s3x client interface

Jump to

Keyboard shortcuts

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