pb

package
v0.0.0-...-cdd27d5 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2019 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Overview

Package pb is a generated twirp stub package. This code was generated with github.com/twitchtv/twirp/protoc-gen-twirp v5.5.2.

It is generated from these files:

fs.proto

Index

Constants

View Source
const FsPathPrefix = "/twirp/fingon.iki.fi.tfhfs.Fs/"

FsPathPrefix is used for all URL paths on a twirp Fs server. Requests are always: POST FsPathPrefix/method It can be used in an HTTP mux to route twirp requests along with non-twirp requests on other routes.

Variables

This section is empty.

Functions

func WriteError

func WriteError(resp http.ResponseWriter, err error)

WriteError writes an HTTP response with a valid Twirp error format. If err is not a twirp.Error, it will get wrapped with twirp.InternalErrorWith(err)

Types

type Block

type Block struct {
	Id                   []byte   `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Status               int32    `protobuf:"varint,2,opt,name=status,proto3" json:"status,omitempty"`
	Data                 []byte   `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"`
	MissingIds           [][]byte `protobuf:"bytes,4,rep,name=missingIds,proto3" json:"missingIds,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Block) Descriptor

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

func (*Block) GetData

func (m *Block) GetData() []byte

func (*Block) GetId

func (m *Block) GetId() []byte

func (*Block) GetMissingIds

func (m *Block) GetMissingIds() [][]byte

func (*Block) GetStatus

func (m *Block) GetStatus() int32

func (*Block) ProtoMessage

func (*Block) ProtoMessage()

func (*Block) Reset

func (m *Block) Reset()

func (*Block) String

func (m *Block) String() string

func (*Block) XXX_DiscardUnknown

func (m *Block) XXX_DiscardUnknown()

func (*Block) XXX_Marshal

func (m *Block) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Block) XXX_Merge

func (m *Block) XXX_Merge(src proto.Message)

func (*Block) XXX_Size

func (m *Block) XXX_Size() int

func (*Block) XXX_Unmarshal

func (m *Block) XXX_Unmarshal(b []byte) error

type BlockId

type BlockId struct {
	Id                   []byte   `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func StringToBlockId

func StringToBlockId(s string) *BlockId

func (*BlockId) Descriptor

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

func (*BlockId) GetId

func (m *BlockId) GetId() []byte

func (*BlockId) ProtoMessage

func (*BlockId) ProtoMessage()

func (*BlockId) Reset

func (m *BlockId) Reset()

func (*BlockId) String

func (m *BlockId) String() string

func (*BlockId) XXX_DiscardUnknown

func (m *BlockId) XXX_DiscardUnknown()

func (*BlockId) XXX_Marshal

func (m *BlockId) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*BlockId) XXX_Merge

func (m *BlockId) XXX_Merge(src proto.Message)

func (*BlockId) XXX_Size

func (m *BlockId) XXX_Size() int

func (*BlockId) XXX_Unmarshal

func (m *BlockId) XXX_Unmarshal(b []byte) error

type BlockName

type BlockName struct {
	Name                 string   `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*BlockName) Descriptor

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

func (*BlockName) GetName

func (m *BlockName) GetName() string

func (*BlockName) ProtoMessage

func (*BlockName) ProtoMessage()

func (*BlockName) Reset

func (m *BlockName) Reset()

func (*BlockName) String

func (m *BlockName) String() string

func (*BlockName) XXX_DiscardUnknown

func (m *BlockName) XXX_DiscardUnknown()

func (*BlockName) XXX_Marshal

func (m *BlockName) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*BlockName) XXX_Merge

func (m *BlockName) XXX_Merge(src proto.Message)

func (*BlockName) XXX_Size

func (m *BlockName) XXX_Size() int

func (*BlockName) XXX_Unmarshal

func (m *BlockName) XXX_Unmarshal(b []byte) error

type ClearResult

type ClearResult struct {
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*ClearResult) Descriptor

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

func (*ClearResult) ProtoMessage

func (*ClearResult) ProtoMessage()

func (*ClearResult) Reset

func (m *ClearResult) Reset()

func (*ClearResult) String

func (m *ClearResult) String() string

func (*ClearResult) XXX_DiscardUnknown

func (m *ClearResult) XXX_DiscardUnknown()

func (*ClearResult) XXX_Marshal

func (m *ClearResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ClearResult) XXX_Merge

func (m *ClearResult) XXX_Merge(src proto.Message)

func (*ClearResult) XXX_Size

func (m *ClearResult) XXX_Size() int

func (*ClearResult) XXX_Unmarshal

func (m *ClearResult) XXX_Unmarshal(b []byte) error

type Fs

type Fs interface {
	ClearBlocksInName(context.Context, *BlockName) (*ClearResult, error)

	// Get block id, or empty if not set.
	GetBlockIdByName(context.Context, *BlockName) (*BlockId, error)

	// Get block
	GetBlockById(context.Context, *GetBlockRequest) (*Block, error)

	MergeBlockNameTo(context.Context, *MergeRequest) (*MergeResult, error)

	SetNameToBlockId(context.Context, *SetNameRequest) (*SetNameResult, error)

	// Store block, normal ref if no weak blocks. (Block is equivalent
	// of GetBlockById(..wantData=false, wantMissing=true)).
	StoreBlock(context.Context, *StoreRequest) (*Block, error)

	// Upgrade block to non-weak status
	UpgradeBlockNonWeak(context.Context, *BlockId) (*Block, error)
}

func NewFsJSONClient

func NewFsJSONClient(addr string, client HTTPClient) Fs

NewFsJSONClient creates a JSON client that implements the Fs interface. It communicates using JSON and can be configured with a custom HTTPClient.

func NewFsProtobufClient

func NewFsProtobufClient(addr string, client HTTPClient) Fs

NewFsProtobufClient creates a Protobuf client that implements the Fs interface. It communicates using Protobuf and can be configured with a custom HTTPClient.

type GetBlockRequest

type GetBlockRequest struct {
	Id                   []byte   `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	WantData             bool     `protobuf:"varint,2,opt,name=wantData,proto3" json:"wantData,omitempty"`
	WantMissing          bool     `protobuf:"varint,3,opt,name=wantMissing,proto3" json:"wantMissing,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*GetBlockRequest) Descriptor

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

func (*GetBlockRequest) GetId

func (m *GetBlockRequest) GetId() []byte

func (*GetBlockRequest) GetWantData

func (m *GetBlockRequest) GetWantData() bool

func (*GetBlockRequest) GetWantMissing

func (m *GetBlockRequest) GetWantMissing() bool

func (*GetBlockRequest) ProtoMessage

func (*GetBlockRequest) ProtoMessage()

func (*GetBlockRequest) Reset

func (m *GetBlockRequest) Reset()

func (*GetBlockRequest) String

func (m *GetBlockRequest) String() string

func (*GetBlockRequest) XXX_DiscardUnknown

func (m *GetBlockRequest) XXX_DiscardUnknown()

func (*GetBlockRequest) XXX_Marshal

func (m *GetBlockRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*GetBlockRequest) XXX_Merge

func (m *GetBlockRequest) XXX_Merge(src proto.Message)

func (*GetBlockRequest) XXX_Size

func (m *GetBlockRequest) XXX_Size() int

func (*GetBlockRequest) XXX_Unmarshal

func (m *GetBlockRequest) XXX_Unmarshal(b []byte) error

type HTTPClient

type HTTPClient interface {
	Do(req *http.Request) (*http.Response, error)
}

HTTPClient is the interface used by generated clients to send HTTP requests. It is fulfilled by *(net/http).Client, which is sufficient for most users. Users can provide their own implementation for special retry policies.

HTTPClient implementations should not follow redirects. Redirects are automatically disabled if *(net/http).Client is passed to client constructors. See the withoutRedirects function in this file for more details.

type MergeRequest

type MergeRequest struct {
	FromName             string   `protobuf:"bytes,1,opt,name=fromName,proto3" json:"fromName,omitempty"`
	ToName               string   `protobuf:"bytes,2,opt,name=toName,proto3" json:"toName,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*MergeRequest) Descriptor

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

func (*MergeRequest) GetFromName

func (m *MergeRequest) GetFromName() string

func (*MergeRequest) GetToName

func (m *MergeRequest) GetToName() string

func (*MergeRequest) ProtoMessage

func (*MergeRequest) ProtoMessage()

func (*MergeRequest) Reset

func (m *MergeRequest) Reset()

func (*MergeRequest) String

func (m *MergeRequest) String() string

func (*MergeRequest) XXX_DiscardUnknown

func (m *MergeRequest) XXX_DiscardUnknown()

func (*MergeRequest) XXX_Marshal

func (m *MergeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MergeRequest) XXX_Merge

func (m *MergeRequest) XXX_Merge(src proto.Message)

func (*MergeRequest) XXX_Size

func (m *MergeRequest) XXX_Size() int

func (*MergeRequest) XXX_Unmarshal

func (m *MergeRequest) XXX_Unmarshal(b []byte) error

type MergeResult

type MergeResult struct {
	Ok                   bool     `protobuf:"varint,1,opt,name=ok,proto3" json:"ok,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*MergeResult) Descriptor

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

func (*MergeResult) GetOk

func (m *MergeResult) GetOk() bool

func (*MergeResult) ProtoMessage

func (*MergeResult) ProtoMessage()

func (*MergeResult) Reset

func (m *MergeResult) Reset()

func (*MergeResult) String

func (m *MergeResult) String() string

func (*MergeResult) XXX_DiscardUnknown

func (m *MergeResult) XXX_DiscardUnknown()

func (*MergeResult) XXX_Marshal

func (m *MergeResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MergeResult) XXX_Merge

func (m *MergeResult) XXX_Merge(src proto.Message)

func (*MergeResult) XXX_Size

func (m *MergeResult) XXX_Size() int

func (*MergeResult) XXX_Unmarshal

func (m *MergeResult) XXX_Unmarshal(b []byte) error

type SetNameRequest

type SetNameRequest struct {
	Name                 string   `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Id                   []byte   `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*SetNameRequest) Descriptor

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

func (*SetNameRequest) GetId

func (m *SetNameRequest) GetId() []byte

func (*SetNameRequest) GetName

func (m *SetNameRequest) GetName() string

func (*SetNameRequest) ProtoMessage

func (*SetNameRequest) ProtoMessage()

func (*SetNameRequest) Reset

func (m *SetNameRequest) Reset()

func (*SetNameRequest) String

func (m *SetNameRequest) String() string

func (*SetNameRequest) XXX_DiscardUnknown

func (m *SetNameRequest) XXX_DiscardUnknown()

func (*SetNameRequest) XXX_Marshal

func (m *SetNameRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*SetNameRequest) XXX_Merge

func (m *SetNameRequest) XXX_Merge(src proto.Message)

func (*SetNameRequest) XXX_Size

func (m *SetNameRequest) XXX_Size() int

func (*SetNameRequest) XXX_Unmarshal

func (m *SetNameRequest) XXX_Unmarshal(b []byte) error

type SetNameResult

type SetNameResult struct {
	Ok                   bool     `protobuf:"varint,1,opt,name=ok,proto3" json:"ok,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*SetNameResult) Descriptor

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

func (*SetNameResult) GetOk

func (m *SetNameResult) GetOk() bool

func (*SetNameResult) ProtoMessage

func (*SetNameResult) ProtoMessage()

func (*SetNameResult) Reset

func (m *SetNameResult) Reset()

func (*SetNameResult) String

func (m *SetNameResult) String() string

func (*SetNameResult) XXX_DiscardUnknown

func (m *SetNameResult) XXX_DiscardUnknown()

func (*SetNameResult) XXX_Marshal

func (m *SetNameResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*SetNameResult) XXX_Merge

func (m *SetNameResult) XXX_Merge(src proto.Message)

func (*SetNameResult) XXX_Size

func (m *SetNameResult) XXX_Size() int

func (*SetNameResult) XXX_Unmarshal

func (m *SetNameResult) XXX_Unmarshal(b []byte) error

type StoreRequest

type StoreRequest struct {
	Name                 string   `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Block                *Block   `protobuf:"bytes,2,opt,name=block,proto3" json:"block,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*StoreRequest) Descriptor

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

func (*StoreRequest) GetBlock

func (m *StoreRequest) GetBlock() *Block

func (*StoreRequest) GetName

func (m *StoreRequest) GetName() string

func (*StoreRequest) ProtoMessage

func (*StoreRequest) ProtoMessage()

func (*StoreRequest) Reset

func (m *StoreRequest) Reset()

func (*StoreRequest) String

func (m *StoreRequest) String() string

func (*StoreRequest) XXX_DiscardUnknown

func (m *StoreRequest) XXX_DiscardUnknown()

func (*StoreRequest) XXX_Marshal

func (m *StoreRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*StoreRequest) XXX_Merge

func (m *StoreRequest) XXX_Merge(src proto.Message)

func (*StoreRequest) XXX_Size

func (m *StoreRequest) XXX_Size() int

func (*StoreRequest) XXX_Unmarshal

func (m *StoreRequest) XXX_Unmarshal(b []byte) error

type TwirpServer

type TwirpServer interface {
	http.Handler
	// ServiceDescriptor returns gzipped bytes describing the .proto file that
	// this service was generated from. Once unzipped, the bytes can be
	// unmarshalled as a
	// github.com/golang/protobuf/protoc-gen-go/descriptor.FileDescriptorProto.
	//
	// The returned integer is the index of this particular service within that
	// FileDescriptorProto's 'Service' slice of ServiceDescriptorProtos. This is a
	// low-level field, expected to be used for reflection.
	ServiceDescriptor() ([]byte, int)
	// ProtocGenTwirpVersion is the semantic version string of the version of
	// twirp used to generate this file.
	ProtocGenTwirpVersion() string
}

TwirpServer is the interface generated server structs will support: they're HTTP handlers with additional methods for accessing metadata about the service. Those accessors are a low-level API for building reflection tools. Most people can think of TwirpServers as just http.Handlers.

func NewFsServer

func NewFsServer(svc Fs, hooks *twirp.ServerHooks) TwirpServer

Jump to

Keyboard shortcuts

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