v3io

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2019 License: Apache-2.0 Imports: 14 Imported by: 45

README

v3io

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidTypeConversion = errors.New("Invalid type conversion")

Functions

This section is empty.

Types

type Bucket

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

type Buckets

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

type CommonPrefix

type CommonPrefix struct {
	XMLName xml.Name `xml:"CommonPrefixes"`
	Prefix  string   `xml:"Prefix"`
}

type Container

type Container struct {
	Sync *SyncContainer
	// contains filtered or unexported fields
}

func (*Container) CreateStream

func (c *Container) CreateStream(input *CreateStreamInput,
	context interface{},
	responseChan chan *Response) (*Request, error)

func (*Container) DeleteObject

func (c *Container) DeleteObject(input *DeleteObjectInput,
	context interface{},
	responseChan chan *Response) (*Request, error)

func (*Container) DeleteStream

func (c *Container) DeleteStream(input *DeleteStreamInput,
	context interface{},
	responseChan chan *Response) (*Request, error)

func (*Container) GetItem

func (c *Container) GetItem(input *GetItemInput,
	context interface{},
	responseChan chan *Response) (*Request, error)

func (*Container) GetItems

func (c *Container) GetItems(input *GetItemsInput,
	context interface{},
	responseChan chan *Response) (*Request, error)

func (*Container) GetObject

func (c *Container) GetObject(input *GetObjectInput,
	context interface{},
	responseChan chan *Response) (*Request, error)

func (*Container) GetRecords

func (c *Container) GetRecords(input *GetRecordsInput,
	context interface{},
	responseChan chan *Response) (*Request, error)

func (*Container) ListAll

func (c *Container) ListAll(input *ListAllInput,
	context interface{},
	responseChan chan *Response) (*Request, error)

func (*Container) ListBucket

func (c *Container) ListBucket(input *ListBucketInput,
	context interface{},
	responseChan chan *Response) (*Request, error)

func (*Container) PutItem

func (c *Container) PutItem(input *PutItemInput,
	context interface{},
	responseChan chan *Response) (*Request, error)

func (*Container) PutItems

func (c *Container) PutItems(input *PutItemsInput,
	context interface{},
	responseChan chan *Response) (*Request, error)

func (*Container) PutObject

func (c *Container) PutObject(input *PutObjectInput,
	context interface{},
	responseChan chan *Response) (*Request, error)

func (*Container) PutRecords

func (c *Container) PutRecords(input *PutRecordsInput,
	context interface{},
	responseChan chan *Response) (*Request, error)

func (*Container) SeekShard

func (c *Container) SeekShard(input *SeekShardInput,
	context interface{},
	responseChan chan *Response) (*Request, error)

func (*Container) UpdateItem

func (c *Container) UpdateItem(input *UpdateItemInput,
	context interface{},
	responseChan chan *Response) (*Request, error)

type Content

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

type Context

type Context struct {
	Sync *SyncContext
	// contains filtered or unexported fields
}

func NewContext

func NewContext(parentLogger logger.Logger, clusterURL string, numWorkers int) (*Context, error)

func (*Context) NewSession

func (c *Context) NewSession(username string, password string, label string) (*Session, error)

func (*Context) NewSessionFromConfig

func (c *Context) NewSessionFromConfig(sc *SessionConfig) (*Session, error)

type CreateStreamInput

type CreateStreamInput struct {
	Path                 string
	ShardCount           int
	RetentionPeriodHours int
}

type DeleteObjectInput

type DeleteObjectInput struct {
	Path string
}

type DeleteStreamInput

type DeleteStreamInput struct {
	Path string
}

type ErrorWithStatusCode

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

ErrorWithStatusCode is an error that holds a status code

func NewErrorWithStatusCode

func NewErrorWithStatusCode(statusCode int, format string, args ...interface{}) ErrorWithStatusCode

NewErrorWithStatusCode creates an error that holds a status code

func (*ErrorWithStatusCode) StatusCode

func (e *ErrorWithStatusCode) StatusCode() int

StatusCode returns the status code of the error

type GetItemInput

type GetItemInput struct {
	Path           string
	AttributeNames []string
}

type GetItemOutput

type GetItemOutput struct {
	Item Item
}

type GetItemsInput

type GetItemsInput struct {
	Path              string
	AttributeNames    []string
	Filter            string
	Marker            string
	ShardingKey       string
	Limit             int
	Segment           int
	TotalSegments     int
	SortKeyRangeStart string
	SortKeyRangeEnd   string
}

type GetItemsOutput

type GetItemsOutput struct {
	Last       bool
	NextMarker string
	Items      []Item
}

type GetObjectInput

type GetObjectInput struct {
	Path string
}

type GetRecordsInput

type GetRecordsInput struct {
	Path     string
	Location string
	Limit    int
}

type GetRecordsOutput

type GetRecordsOutput struct {
	NextLocation        string
	MSecBehindLatest    int
	RecordsBehindLatest int
	Records             []GetRecordsResult
}

type GetRecordsResult

type GetRecordsResult struct {
	ArrivalTimeSec  int
	ArrivalTimeNSec int
	SequenceNumber  int
	ClientInfo      []byte
	PartitionKey    string
	Data            []byte
}

type Item

type Item map[string]interface{}

func (Item) GetField

func (i Item) GetField(name string) interface{}

func (Item) GetFieldInt

func (i Item) GetFieldInt(name string) (int, error)

func (Item) GetFieldString

func (i Item) GetFieldString(name string) (string, error)

type ItemsCursor

type ItemsCursor struct {
	Sync *SyncItemsCursor
}

type ListAllInput

type ListAllInput struct {
}

type ListAllOutput

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

type ListBucketInput

type ListBucketInput struct {
	Path string
}

type ListBucketOutput

type ListBucketOutput struct {
	XMLName        xml.Name       `xml:"ListBucketResult"`
	Name           string         `xml:"Name"`
	NextMarker     string         `xml:"NextMarker"`
	MaxKeys        string         `xml:"MaxKeys"`
	Contents       []Content      `xml:"Contents"`
	CommonPrefixes []CommonPrefix `xml:"CommonPrefixes"`
}

type PutItemInput

type PutItemInput struct {
	Path       string
	Condition  string
	Attributes map[string]interface{}
}

type PutItemsInput

type PutItemsInput struct {
	Path      string
	Condition string
	Items     map[string]map[string]interface{}
}

type PutItemsOutput

type PutItemsOutput struct {
	Success bool
	Errors  map[string]error
}

type PutObjectInput

type PutObjectInput struct {
	Path string
	Body []byte
}

type PutRecordResult

type PutRecordResult struct {
	SequenceNumber int
	ShardID        int `json:"ShardId"`
	ErrorCode      int
	ErrorMessage   string
}

type PutRecordsInput

type PutRecordsInput struct {
	Path    string
	Records []*StreamRecord
}

type PutRecordsOutput

type PutRecordsOutput struct {
	FailedRecordCount int
	Records           []PutRecordResult
}

type Request

type Request struct {
	ID uint64

	// holds the input (e.g. ListBucketInput, GetItemInput)
	Input interface{}

	// a user supplied context
	Context interface{}

	// Request time
	SendTimeNanoseconds int64
	// contains filtered or unexported fields
}

type RequestResponse

type RequestResponse struct {
	Request  Request
	Response Response
}

holds both a request and response

type Response

type Response struct {

	// hold a decoded output, if any
	Output interface{}

	// Equal to the ID of request
	ID uint64

	// holds the error for async responses
	Error error

	// a user supplied context
	Context interface{}
	// contains filtered or unexported fields
}

func (*Response) Body

func (r *Response) Body() []byte

func (*Response) Release

func (r *Response) Release()

func (*Response) Request

func (r *Response) Request() *Request

type SeekShardInput

type SeekShardInput struct {
	Path                   string
	Type                   SeekShardInputType
	StartingSequenceNumber int
	Timestamp              int
}

type SeekShardInputType

type SeekShardInputType int
const (
	SeekShardInputTypeTime SeekShardInputType = iota
	SeekShardInputTypeSequence
	SeekShardInputTypeLatest
	SeekShardInputTypeEarliest
)

type SeekShardOutput

type SeekShardOutput struct {
	Location string
}

type Session

type Session struct {
	Sync *SyncSession
	// contains filtered or unexported fields
}

func (*Session) ListAll

func (s *Session) ListAll(input *ListAllInput,
	context interface{},
	responseChan chan *Response) (*Request, error)

func (*Session) NewContainer

func (s *Session) NewContainer(alias string) (*Container, error)

type SessionConfig

type SessionConfig struct {
	Username   string
	Password   string
	Label      string
	SessionKey string
}

type SetObjectInput

type SetObjectInput struct {
	Path                       string
	ValidationModifiedTimeSec  uint64
	ValidationModifiedTimeNsec uint64
	ValidationOperation        string
	ValidationMask             uint64
	ValidationValue            uint64
	SetOperation               string
	DataMask                   uint64
	DataValue                  uint64
}

type StreamRecord

type StreamRecord struct {
	ShardID      *int
	Data         []byte
	ClientInfo   []byte
	PartitionKey string
}

type SyncContainer

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

func (*SyncContainer) CreateStream

func (sc *SyncContainer) CreateStream(input *CreateStreamInput) error

func (*SyncContainer) DeleteObject

func (sc *SyncContainer) DeleteObject(input *DeleteObjectInput) error

func (*SyncContainer) DeleteStream

func (sc *SyncContainer) DeleteStream(input *DeleteStreamInput) error

func (*SyncContainer) GetItem

func (sc *SyncContainer) GetItem(input *GetItemInput) (*Response, error)

func (*SyncContainer) GetItems

func (sc *SyncContainer) GetItems(input *GetItemsInput) (*Response, error)

func (*SyncContainer) GetItemsCursor

func (sc *SyncContainer) GetItemsCursor(input *GetItemsInput) (*SyncItemsCursor, error)

func (*SyncContainer) GetObject

func (sc *SyncContainer) GetObject(input *GetObjectInput) (*Response, error)

func (*SyncContainer) GetRecords

func (sc *SyncContainer) GetRecords(input *GetRecordsInput) (*Response, error)

func (*SyncContainer) ListBucket

func (sc *SyncContainer) ListBucket(input *ListBucketInput) (*Response, error)

func (*SyncContainer) PutItem

func (sc *SyncContainer) PutItem(input *PutItemInput) error

func (*SyncContainer) PutItems

func (sc *SyncContainer) PutItems(input *PutItemsInput) (*Response, error)

func (*SyncContainer) PutObject

func (sc *SyncContainer) PutObject(input *PutObjectInput) error

func (*SyncContainer) PutRecords

func (sc *SyncContainer) PutRecords(input *PutRecordsInput) (*Response, error)

func (*SyncContainer) SeekShard

func (sc *SyncContainer) SeekShard(input *SeekShardInput) (*Response, error)

func (*SyncContainer) UpdateItem

func (sc *SyncContainer) UpdateItem(input *UpdateItemInput) error

type SyncContext

type SyncContext struct {
	Timeout time.Duration
	// contains filtered or unexported fields
}

type SyncItemsCursor

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

func (*SyncItemsCursor) All

func (ic *SyncItemsCursor) All() ([]Item, error)

gets all items

func (*SyncItemsCursor) Err

func (ic *SyncItemsCursor) Err() error

Err returns the last error

func (*SyncItemsCursor) GetField

func (ic *SyncItemsCursor) GetField(name string) interface{}

func (*SyncItemsCursor) GetFieldInt

func (ic *SyncItemsCursor) GetFieldInt(name string) (int, error)

func (*SyncItemsCursor) GetFieldString

func (ic *SyncItemsCursor) GetFieldString(name string) (string, error)

func (*SyncItemsCursor) GetFields

func (ic *SyncItemsCursor) GetFields() map[string]interface{}

func (*SyncItemsCursor) GetItem

func (ic *SyncItemsCursor) GetItem() Item

func (*SyncItemsCursor) Next

func (ic *SyncItemsCursor) Next() bool

Next gets the next matching item. this may potentially block as this lazy loads items from the collection

func (*SyncItemsCursor) NextItem

func (ic *SyncItemsCursor) NextItem() (Item, error)

NextItem gets the next matching item. this may potentially block as this lazy loads items from the collection

func (*SyncItemsCursor) Release

func (ic *SyncItemsCursor) Release()

Release releases a cursor and its underlying resources

type SyncSession

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

func (*SyncSession) ListAll

func (ss *SyncSession) ListAll() (*Response, error)

type UpdateItemInput

type UpdateItemInput struct {
	Path       string
	Attributes map[string]interface{}
	Expression *string
	Condition  string
}

Jump to

Keyboard shortcuts

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