models

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2016 License: Apache-2.0 Imports: 8 Imported by: 78

Documentation

Overview

models is the package containing all the protos used for serializing data for Torus.

Package models is a generated protocol buffer package.

It is generated from these files:
	rpc.proto
	torus.proto

It has these top-level messages:
	BlockRequest
	BlockResponse
	PutBlockRequest
	PutResponse
	RebalanceCheckRequest
	RebalanceCheckResponse
	INode
	BlockLayer
	Volume
	PeerInfo
	RebalanceInfo
	Ring
	BlockRef
	INodeRef

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthRpc = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowRpc   = fmt.Errorf("proto: integer overflow")
)
View Source
var (
	ErrInvalidLengthTorus = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowTorus   = fmt.Errorf("proto: integer overflow")
)

Functions

func RegisterTorusStorageServer added in v0.1.0

func RegisterTorusStorageServer(s *grpc.Server, srv TorusStorageServer)

Types

type BlockLayer

type BlockLayer struct {
	Type    uint32 `protobuf:"varint,1,opt,name=type,proto3" json:"type,omitempty"`
	Content []byte `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"`
}

func NewPopulatedBlockLayer

func NewPopulatedBlockLayer(r randyTorus, easy bool) *BlockLayer

func (*BlockLayer) Descriptor

func (*BlockLayer) Descriptor() ([]byte, []int)

func (*BlockLayer) Equal

func (this *BlockLayer) Equal(that interface{}) bool

func (*BlockLayer) Marshal

func (m *BlockLayer) Marshal() (data []byte, err error)

func (*BlockLayer) MarshalTo

func (m *BlockLayer) MarshalTo(data []byte) (int, error)

func (*BlockLayer) ProtoMessage

func (*BlockLayer) ProtoMessage()

func (*BlockLayer) Reset

func (m *BlockLayer) Reset()

func (*BlockLayer) Size

func (m *BlockLayer) Size() (n int)

func (*BlockLayer) String

func (m *BlockLayer) String() string

func (*BlockLayer) Unmarshal

func (m *BlockLayer) Unmarshal(data []byte) error

func (*BlockLayer) VerboseEqual

func (this *BlockLayer) VerboseEqual(that interface{}) error

type BlockRef

type BlockRef struct {
	Volume uint64 `protobuf:"varint,1,opt,name=volume,proto3" json:"volume,omitempty"`
	INode  uint64 `protobuf:"varint,2,opt,name=inode,proto3" json:"inode,omitempty"`
	Block  uint64 `protobuf:"varint,3,opt,name=block,proto3" json:"block,omitempty"`
}

func NewPopulatedBlockRef

func NewPopulatedBlockRef(r randyTorus, easy bool) *BlockRef

func (*BlockRef) Descriptor

func (*BlockRef) Descriptor() ([]byte, []int)

func (*BlockRef) Equal

func (this *BlockRef) Equal(that interface{}) bool

func (*BlockRef) Marshal

func (m *BlockRef) Marshal() (data []byte, err error)

func (*BlockRef) MarshalTo

func (m *BlockRef) MarshalTo(data []byte) (int, error)

func (*BlockRef) ProtoMessage

func (*BlockRef) ProtoMessage()

func (*BlockRef) Reset

func (m *BlockRef) Reset()

func (*BlockRef) Size

func (m *BlockRef) Size() (n int)

func (*BlockRef) String

func (m *BlockRef) String() string

func (*BlockRef) Unmarshal

func (m *BlockRef) Unmarshal(data []byte) error

func (*BlockRef) VerboseEqual

func (this *BlockRef) VerboseEqual(that interface{}) error

type BlockRequest

type BlockRequest struct {
	BlockRef *BlockRef `protobuf:"bytes,1,opt,name=block_ref" json:"block_ref,omitempty"`
}

func NewPopulatedBlockRequest

func NewPopulatedBlockRequest(r randyRpc, easy bool) *BlockRequest

func (*BlockRequest) Descriptor

func (*BlockRequest) Descriptor() ([]byte, []int)

func (*BlockRequest) Equal

func (this *BlockRequest) Equal(that interface{}) bool

func (*BlockRequest) GetBlockRef

func (m *BlockRequest) GetBlockRef() *BlockRef

func (*BlockRequest) Marshal

func (m *BlockRequest) Marshal() (data []byte, err error)

func (*BlockRequest) MarshalTo

func (m *BlockRequest) MarshalTo(data []byte) (int, error)

func (*BlockRequest) ProtoMessage

func (*BlockRequest) ProtoMessage()

func (*BlockRequest) Reset

func (m *BlockRequest) Reset()

func (*BlockRequest) Size

func (m *BlockRequest) Size() (n int)

func (*BlockRequest) String

func (m *BlockRequest) String() string

func (*BlockRequest) Unmarshal

func (m *BlockRequest) Unmarshal(data []byte) error

func (*BlockRequest) VerboseEqual

func (this *BlockRequest) VerboseEqual(that interface{}) error

type BlockResponse

type BlockResponse struct {
	Ok   bool   `protobuf:"varint,1,opt,name=ok,proto3" json:"ok,omitempty"`
	Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
}

func NewPopulatedBlockResponse

func NewPopulatedBlockResponse(r randyRpc, easy bool) *BlockResponse

func (*BlockResponse) Descriptor

func (*BlockResponse) Descriptor() ([]byte, []int)

func (*BlockResponse) Equal

func (this *BlockResponse) Equal(that interface{}) bool

func (*BlockResponse) Marshal

func (m *BlockResponse) Marshal() (data []byte, err error)

func (*BlockResponse) MarshalTo

func (m *BlockResponse) MarshalTo(data []byte) (int, error)

func (*BlockResponse) ProtoMessage

func (*BlockResponse) ProtoMessage()

func (*BlockResponse) Reset

func (m *BlockResponse) Reset()

func (*BlockResponse) Size

func (m *BlockResponse) Size() (n int)

func (*BlockResponse) String

func (m *BlockResponse) String() string

func (*BlockResponse) Unmarshal

func (m *BlockResponse) Unmarshal(data []byte) error

func (*BlockResponse) VerboseEqual

func (this *BlockResponse) VerboseEqual(that interface{}) error

type INode

type INode struct {
	Volume   uint64            `protobuf:"varint,1,opt,name=volume,proto3" json:"volume,omitempty"`
	INode    uint64            `protobuf:"varint,2,opt,name=inode,proto3" json:"inode,omitempty"`
	Filesize uint64            `protobuf:"varint,4,opt,name=filesize,proto3" json:"filesize,omitempty"`
	Attrs    map[string]string `` /* 144-byte string literal not displayed */
	Blocks   []*BlockLayer     `protobuf:"bytes,8,rep,name=blocks" json:"blocks,omitempty"`
}

func NewEmptyINode

func NewEmptyINode() *INode

func NewPopulatedINode

func NewPopulatedINode(r randyTorus, easy bool) *INode

func (*INode) Descriptor

func (*INode) Descriptor() ([]byte, []int)

func (*INode) Equal

func (this *INode) Equal(that interface{}) bool

func (*INode) GetAttrs

func (m *INode) GetAttrs() map[string]string

func (*INode) GetBlocks

func (m *INode) GetBlocks() []*BlockLayer

func (*INode) Marshal

func (m *INode) Marshal() (data []byte, err error)

func (*INode) MarshalTo

func (m *INode) MarshalTo(data []byte) (int, error)

func (*INode) ProtoMessage

func (*INode) ProtoMessage()

func (*INode) Reset

func (m *INode) Reset()

func (*INode) Size

func (m *INode) Size() (n int)

func (*INode) String

func (m *INode) String() string

func (*INode) Unmarshal

func (m *INode) Unmarshal(data []byte) error

func (*INode) VerboseEqual

func (this *INode) VerboseEqual(that interface{}) error

type INodeRef

type INodeRef struct {
	Volume uint64 `protobuf:"varint,1,opt,name=volume,proto3" json:"volume,omitempty"`
	INode  uint64 `protobuf:"varint,2,opt,name=inode,proto3" json:"inode,omitempty"`
}

func NewPopulatedINodeRef

func NewPopulatedINodeRef(r randyTorus, easy bool) *INodeRef

func (*INodeRef) Descriptor

func (*INodeRef) Descriptor() ([]byte, []int)

func (*INodeRef) Equal

func (this *INodeRef) Equal(that interface{}) bool

func (*INodeRef) Marshal

func (m *INodeRef) Marshal() (data []byte, err error)

func (*INodeRef) MarshalTo

func (m *INodeRef) MarshalTo(data []byte) (int, error)

func (*INodeRef) ProtoMessage

func (*INodeRef) ProtoMessage()

func (*INodeRef) Reset

func (m *INodeRef) Reset()

func (*INodeRef) Size

func (m *INodeRef) Size() (n int)

func (*INodeRef) String

func (m *INodeRef) String() string

func (*INodeRef) Unmarshal

func (m *INodeRef) Unmarshal(data []byte) error

func (*INodeRef) VerboseEqual

func (this *INodeRef) VerboseEqual(that interface{}) error

type PeerInfo

type PeerInfo struct {
	UUID          string         `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"`
	Address       string         `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"`
	LastSeen      int64          `protobuf:"varint,3,opt,name=last_seen,proto3" json:"last_seen,omitempty"`
	TotalBlocks   uint64         `protobuf:"varint,4,opt,name=total_blocks,proto3" json:"total_blocks,omitempty"`
	UsedBlocks    uint64         `protobuf:"varint,5,opt,name=used_blocks,proto3" json:"used_blocks,omitempty"`
	TimedOut      bool           `protobuf:"varint,6,opt,name=timed_out,proto3" json:"timed_out,omitempty"`
	RebalanceInfo *RebalanceInfo `protobuf:"bytes,7,opt,name=rebalance_info" json:"rebalance_info,omitempty"`
	// ProtocolVersion is set by each peer to know if we're out of date or if a
	// protocol migration has occured.
	ProtocolVersion uint64 `protobuf:"varint,8,opt,name=protocol_version,proto3" json:"protocol_version,omitempty"`
}

func NewPopulatedPeerInfo

func NewPopulatedPeerInfo(r randyTorus, easy bool) *PeerInfo

func (*PeerInfo) Descriptor

func (*PeerInfo) Descriptor() ([]byte, []int)

func (*PeerInfo) Equal

func (this *PeerInfo) Equal(that interface{}) bool

func (*PeerInfo) GetRebalanceInfo

func (m *PeerInfo) GetRebalanceInfo() *RebalanceInfo

func (*PeerInfo) Marshal

func (m *PeerInfo) Marshal() (data []byte, err error)

func (*PeerInfo) MarshalTo

func (m *PeerInfo) MarshalTo(data []byte) (int, error)

func (*PeerInfo) ProtoMessage

func (*PeerInfo) ProtoMessage()

func (*PeerInfo) Reset

func (m *PeerInfo) Reset()

func (*PeerInfo) Size

func (m *PeerInfo) Size() (n int)

func (*PeerInfo) String

func (m *PeerInfo) String() string

func (*PeerInfo) Unmarshal

func (m *PeerInfo) Unmarshal(data []byte) error

func (*PeerInfo) VerboseEqual

func (this *PeerInfo) VerboseEqual(that interface{}) error

type PutBlockRequest

type PutBlockRequest struct {
	Refs   []*BlockRef `protobuf:"bytes,1,rep,name=refs" json:"refs,omitempty"`
	Blocks [][]byte    `protobuf:"bytes,2,rep,name=blocks" json:"blocks,omitempty"`
}

func NewPopulatedPutBlockRequest

func NewPopulatedPutBlockRequest(r randyRpc, easy bool) *PutBlockRequest

func (*PutBlockRequest) Descriptor

func (*PutBlockRequest) Descriptor() ([]byte, []int)

func (*PutBlockRequest) Equal

func (this *PutBlockRequest) Equal(that interface{}) bool

func (*PutBlockRequest) GetRefs

func (m *PutBlockRequest) GetRefs() []*BlockRef

func (*PutBlockRequest) Marshal

func (m *PutBlockRequest) Marshal() (data []byte, err error)

func (*PutBlockRequest) MarshalTo

func (m *PutBlockRequest) MarshalTo(data []byte) (int, error)

func (*PutBlockRequest) ProtoMessage

func (*PutBlockRequest) ProtoMessage()

func (*PutBlockRequest) Reset

func (m *PutBlockRequest) Reset()

func (*PutBlockRequest) Size

func (m *PutBlockRequest) Size() (n int)

func (*PutBlockRequest) String

func (m *PutBlockRequest) String() string

func (*PutBlockRequest) Unmarshal

func (m *PutBlockRequest) Unmarshal(data []byte) error

func (*PutBlockRequest) VerboseEqual

func (this *PutBlockRequest) VerboseEqual(that interface{}) error

type PutResponse

type PutResponse struct {
	Ok  bool   `protobuf:"varint,1,opt,name=ok,proto3" json:"ok,omitempty"`
	Err string `protobuf:"bytes,2,opt,name=err,proto3" json:"err,omitempty"`
}

func NewPopulatedPutResponse

func NewPopulatedPutResponse(r randyRpc, easy bool) *PutResponse

func (*PutResponse) Descriptor

func (*PutResponse) Descriptor() ([]byte, []int)

func (*PutResponse) Equal

func (this *PutResponse) Equal(that interface{}) bool

func (*PutResponse) Marshal

func (m *PutResponse) Marshal() (data []byte, err error)

func (*PutResponse) MarshalTo

func (m *PutResponse) MarshalTo(data []byte) (int, error)

func (*PutResponse) ProtoMessage

func (*PutResponse) ProtoMessage()

func (*PutResponse) Reset

func (m *PutResponse) Reset()

func (*PutResponse) Size

func (m *PutResponse) Size() (n int)

func (*PutResponse) String

func (m *PutResponse) String() string

func (*PutResponse) Unmarshal

func (m *PutResponse) Unmarshal(data []byte) error

func (*PutResponse) VerboseEqual

func (this *PutResponse) VerboseEqual(that interface{}) error

type RebalanceCheckRequest

type RebalanceCheckRequest struct {
	BlockRefs []*BlockRef `protobuf:"bytes,1,rep,name=block_refs" json:"block_refs,omitempty"`
}

func NewPopulatedRebalanceCheckRequest

func NewPopulatedRebalanceCheckRequest(r randyRpc, easy bool) *RebalanceCheckRequest

func (*RebalanceCheckRequest) Descriptor

func (*RebalanceCheckRequest) Descriptor() ([]byte, []int)

func (*RebalanceCheckRequest) Equal

func (this *RebalanceCheckRequest) Equal(that interface{}) bool

func (*RebalanceCheckRequest) GetBlockRefs

func (m *RebalanceCheckRequest) GetBlockRefs() []*BlockRef

func (*RebalanceCheckRequest) Marshal

func (m *RebalanceCheckRequest) Marshal() (data []byte, err error)

func (*RebalanceCheckRequest) MarshalTo

func (m *RebalanceCheckRequest) MarshalTo(data []byte) (int, error)

func (*RebalanceCheckRequest) ProtoMessage

func (*RebalanceCheckRequest) ProtoMessage()

func (*RebalanceCheckRequest) Reset

func (m *RebalanceCheckRequest) Reset()

func (*RebalanceCheckRequest) Size

func (m *RebalanceCheckRequest) Size() (n int)

func (*RebalanceCheckRequest) String

func (m *RebalanceCheckRequest) String() string

func (*RebalanceCheckRequest) Unmarshal

func (m *RebalanceCheckRequest) Unmarshal(data []byte) error

func (*RebalanceCheckRequest) VerboseEqual

func (this *RebalanceCheckRequest) VerboseEqual(that interface{}) error

type RebalanceCheckResponse

type RebalanceCheckResponse struct {
	Valid  []bool `protobuf:"varint,1,rep,name=valid" json:"valid,omitempty"`
	Status int32  `protobuf:"varint,2,opt,name=status,proto3" json:"status,omitempty"`
}

func NewPopulatedRebalanceCheckResponse

func NewPopulatedRebalanceCheckResponse(r randyRpc, easy bool) *RebalanceCheckResponse

func (*RebalanceCheckResponse) Descriptor

func (*RebalanceCheckResponse) Descriptor() ([]byte, []int)

func (*RebalanceCheckResponse) Equal

func (this *RebalanceCheckResponse) Equal(that interface{}) bool

func (*RebalanceCheckResponse) Marshal

func (m *RebalanceCheckResponse) Marshal() (data []byte, err error)

func (*RebalanceCheckResponse) MarshalTo

func (m *RebalanceCheckResponse) MarshalTo(data []byte) (int, error)

func (*RebalanceCheckResponse) ProtoMessage

func (*RebalanceCheckResponse) ProtoMessage()

func (*RebalanceCheckResponse) Reset

func (m *RebalanceCheckResponse) Reset()

func (*RebalanceCheckResponse) Size

func (m *RebalanceCheckResponse) Size() (n int)

func (*RebalanceCheckResponse) String

func (m *RebalanceCheckResponse) String() string

func (*RebalanceCheckResponse) Unmarshal

func (m *RebalanceCheckResponse) Unmarshal(data []byte) error

func (*RebalanceCheckResponse) VerboseEqual

func (this *RebalanceCheckResponse) VerboseEqual(that interface{}) error

type RebalanceInfo

type RebalanceInfo struct {
	LastRebalanceFinish int64  `protobuf:"varint,1,opt,name=last_rebalance_finish,proto3" json:"last_rebalance_finish,omitempty"`
	LastRebalanceBlocks uint64 `protobuf:"varint,2,opt,name=last_rebalance_blocks,proto3" json:"last_rebalance_blocks,omitempty"`
	Rebalancing         bool   `protobuf:"varint,3,opt,name=rebalancing,proto3" json:"rebalancing,omitempty"`
}

func NewPopulatedRebalanceInfo

func NewPopulatedRebalanceInfo(r randyTorus, easy bool) *RebalanceInfo

func (*RebalanceInfo) Descriptor

func (*RebalanceInfo) Descriptor() ([]byte, []int)

func (*RebalanceInfo) Equal

func (this *RebalanceInfo) Equal(that interface{}) bool

func (*RebalanceInfo) Marshal

func (m *RebalanceInfo) Marshal() (data []byte, err error)

func (*RebalanceInfo) MarshalTo

func (m *RebalanceInfo) MarshalTo(data []byte) (int, error)

func (*RebalanceInfo) ProtoMessage

func (*RebalanceInfo) ProtoMessage()

func (*RebalanceInfo) Reset

func (m *RebalanceInfo) Reset()

func (*RebalanceInfo) Size

func (m *RebalanceInfo) Size() (n int)

func (*RebalanceInfo) String

func (m *RebalanceInfo) String() string

func (*RebalanceInfo) Unmarshal

func (m *RebalanceInfo) Unmarshal(data []byte) error

func (*RebalanceInfo) VerboseEqual

func (this *RebalanceInfo) VerboseEqual(that interface{}) error

type Ring

type Ring struct {
	Type              uint32            `protobuf:"varint,1,opt,name=type,proto3" json:"type,omitempty"`
	Version           uint32            `protobuf:"varint,2,opt,name=version,proto3" json:"version,omitempty"`
	ReplicationFactor uint32            `protobuf:"varint,3,opt,name=replication_factor,proto3" json:"replication_factor,omitempty"`
	Peers             []*PeerInfo       `protobuf:"bytes,4,rep,name=peers" json:"peers,omitempty"`
	Attrs             map[string][]byte `` /* 144-byte string literal not displayed */
}

func NewPopulatedRing

func NewPopulatedRing(r randyTorus, easy bool) *Ring

func (*Ring) Descriptor

func (*Ring) Descriptor() ([]byte, []int)

func (*Ring) Equal

func (this *Ring) Equal(that interface{}) bool

func (*Ring) GetAttrs

func (m *Ring) GetAttrs() map[string][]byte

func (*Ring) GetPeers

func (m *Ring) GetPeers() []*PeerInfo

func (*Ring) Marshal

func (m *Ring) Marshal() (data []byte, err error)

func (*Ring) MarshalTo

func (m *Ring) MarshalTo(data []byte) (int, error)

func (*Ring) ProtoMessage

func (*Ring) ProtoMessage()

func (*Ring) Reset

func (m *Ring) Reset()

func (*Ring) Size

func (m *Ring) Size() (n int)

func (*Ring) String

func (m *Ring) String() string

func (*Ring) Unmarshal

func (m *Ring) Unmarshal(data []byte) error

func (*Ring) VerboseEqual

func (this *Ring) VerboseEqual(that interface{}) error

type TorusStorageClient added in v0.1.0

type TorusStorageClient interface {
	Block(ctx context.Context, in *BlockRequest, opts ...grpc.CallOption) (*BlockResponse, error)
	PutBlock(ctx context.Context, in *PutBlockRequest, opts ...grpc.CallOption) (*PutResponse, error)
	RebalanceCheck(ctx context.Context, in *RebalanceCheckRequest, opts ...grpc.CallOption) (*RebalanceCheckResponse, error)
}

func NewTorusStorageClient added in v0.1.0

func NewTorusStorageClient(cc *grpc.ClientConn) TorusStorageClient

type TorusStorageServer added in v0.1.0

type TorusStorageServer interface {
	Block(context.Context, *BlockRequest) (*BlockResponse, error)
	PutBlock(context.Context, *PutBlockRequest) (*PutResponse, error)
	RebalanceCheck(context.Context, *RebalanceCheckRequest) (*RebalanceCheckResponse, error)
}

type Volume

type Volume struct {
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Id   uint64 `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"`
	Type string `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"`
	// TODO(barakmich): Respect sizes for FILE volumes.
	MaxBytes uint64 `protobuf:"varint,4,opt,name=max_bytes,proto3" json:"max_bytes,omitempty"`
}

func NewPopulatedVolume

func NewPopulatedVolume(r randyTorus, easy bool) *Volume

func (*Volume) Descriptor

func (*Volume) Descriptor() ([]byte, []int)

func (*Volume) Equal

func (this *Volume) Equal(that interface{}) bool

func (*Volume) Marshal

func (m *Volume) Marshal() (data []byte, err error)

func (*Volume) MarshalTo

func (m *Volume) MarshalTo(data []byte) (int, error)

func (*Volume) ProtoMessage

func (*Volume) ProtoMessage()

func (*Volume) Reset

func (m *Volume) Reset()

func (*Volume) Size

func (m *Volume) Size() (n int)

func (*Volume) String

func (m *Volume) String() string

func (*Volume) Unmarshal

func (m *Volume) Unmarshal(data []byte) error

func (*Volume) VerboseEqual

func (this *Volume) VerboseEqual(that interface{}) error

Jump to

Keyboard shortcuts

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