pb

package
v0.0.0-...-0548c99 Latest Latest
Warning

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

Go to latest
Published: May 11, 2018 License: GPL-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package pb is a generated protocol buffer package.

It is generated from these files:

service.proto

It has these top-level messages:

SubscribeJobRequest
SubscribeJobResponse
ReportJobRequest
ReportJobResponse
ReportJobDoneRequest
ReportJobDoneResponse

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

It is generated from these files:

service.proto

Index

Constants

View Source
const LoomPathPrefix = "/twirp/loom.server.Loom/"

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

Variables

View Source
var SubscribeJobResponse_Status_name = map[int32]string{
	0: "NoJob",
	1: "NewJob",
}
View Source
var SubscribeJobResponse_Status_value = map[string]int32{
	"NoJob":  0,
	"NewJob": 1,
}

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 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 Loom

func NewLoomJSONClient

func NewLoomJSONClient(addr string, client HTTPClient) Loom

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

func NewLoomProtobufClient

func NewLoomProtobufClient(addr string, client HTTPClient) Loom

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

type ReportJobDoneRequest

type ReportJobDoneRequest struct {
	JobId     []byte `protobuf:"bytes,1,opt,name=job_id,json=jobId,proto3" json:"job_id,omitempty"`
	WorkerId  string `protobuf:"bytes,2,opt,name=worker_id,json=workerId" json:"worker_id,omitempty"`
	TopicName string `protobuf:"bytes,3,opt,name=topic_name,json=topicName" json:"topic_name,omitempty"`
}

func (*ReportJobDoneRequest) Descriptor

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

func (*ReportJobDoneRequest) GetJobId

func (m *ReportJobDoneRequest) GetJobId() []byte

func (*ReportJobDoneRequest) GetTopicName

func (m *ReportJobDoneRequest) GetTopicName() string

func (*ReportJobDoneRequest) GetWorkerId

func (m *ReportJobDoneRequest) GetWorkerId() string

func (*ReportJobDoneRequest) ProtoMessage

func (*ReportJobDoneRequest) ProtoMessage()

func (*ReportJobDoneRequest) Reset

func (m *ReportJobDoneRequest) Reset()

func (*ReportJobDoneRequest) String

func (m *ReportJobDoneRequest) String() string

type ReportJobDoneResponse

type ReportJobDoneResponse struct {
}

func (*ReportJobDoneResponse) Descriptor

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

func (*ReportJobDoneResponse) ProtoMessage

func (*ReportJobDoneResponse) ProtoMessage()

func (*ReportJobDoneResponse) Reset

func (m *ReportJobDoneResponse) Reset()

func (*ReportJobDoneResponse) String

func (m *ReportJobDoneResponse) String() string

type ReportJobRequest

type ReportJobRequest struct {
	JobId     []byte `protobuf:"bytes,1,opt,name=job_id,json=jobId,proto3" json:"job_id,omitempty"`
	WorkerId  string `protobuf:"bytes,2,opt,name=worker_id,json=workerId" json:"worker_id,omitempty"`
	TopicName string `protobuf:"bytes,3,opt,name=topic_name,json=topicName" json:"topic_name,omitempty"`
	JobMsg    []byte `protobuf:"bytes,4,opt,name=job_msg,json=jobMsg,proto3" json:"job_msg,omitempty"`
}

func (*ReportJobRequest) Descriptor

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

func (*ReportJobRequest) GetJobId

func (m *ReportJobRequest) GetJobId() []byte

func (*ReportJobRequest) GetJobMsg

func (m *ReportJobRequest) GetJobMsg() []byte

func (*ReportJobRequest) GetTopicName

func (m *ReportJobRequest) GetTopicName() string

func (*ReportJobRequest) GetWorkerId

func (m *ReportJobRequest) GetWorkerId() string

func (*ReportJobRequest) ProtoMessage

func (*ReportJobRequest) ProtoMessage()

func (*ReportJobRequest) Reset

func (m *ReportJobRequest) Reset()

func (*ReportJobRequest) String

func (m *ReportJobRequest) String() string

type ReportJobResponse

type ReportJobResponse struct {
}

func (*ReportJobResponse) Descriptor

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

func (*ReportJobResponse) ProtoMessage

func (*ReportJobResponse) ProtoMessage()

func (*ReportJobResponse) Reset

func (m *ReportJobResponse) Reset()

func (*ReportJobResponse) String

func (m *ReportJobResponse) String() string

type SubscribeJobRequest

type SubscribeJobRequest struct {
	WorkerId  string `protobuf:"bytes,1,opt,name=worker_id,json=workerId" json:"worker_id,omitempty"`
	TopicName string `protobuf:"bytes,2,opt,name=topic_name,json=topicName" json:"topic_name,omitempty"`
}

func (*SubscribeJobRequest) Descriptor

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

func (*SubscribeJobRequest) GetTopicName

func (m *SubscribeJobRequest) GetTopicName() string

func (*SubscribeJobRequest) GetWorkerId

func (m *SubscribeJobRequest) GetWorkerId() string

func (*SubscribeJobRequest) ProtoMessage

func (*SubscribeJobRequest) ProtoMessage()

func (*SubscribeJobRequest) Reset

func (m *SubscribeJobRequest) Reset()

func (*SubscribeJobRequest) String

func (m *SubscribeJobRequest) String() string

type SubscribeJobResponse

type SubscribeJobResponse struct {
	JobId     []byte                      `protobuf:"bytes,1,opt,name=job_id,json=jobId,proto3" json:"job_id,omitempty"`
	JobMsg    []byte                      `protobuf:"bytes,2,opt,name=job_msg,json=jobMsg,proto3" json:"job_msg,omitempty"`
	JobStatus SubscribeJobResponse_Status `` /* 127-byte string literal not displayed */
}

func (*SubscribeJobResponse) Descriptor

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

func (*SubscribeJobResponse) GetJobId

func (m *SubscribeJobResponse) GetJobId() []byte

func (*SubscribeJobResponse) GetJobMsg

func (m *SubscribeJobResponse) GetJobMsg() []byte

func (*SubscribeJobResponse) GetJobStatus

func (*SubscribeJobResponse) ProtoMessage

func (*SubscribeJobResponse) ProtoMessage()

func (*SubscribeJobResponse) Reset

func (m *SubscribeJobResponse) Reset()

func (*SubscribeJobResponse) String

func (m *SubscribeJobResponse) String() string

type SubscribeJobResponse_Status

type SubscribeJobResponse_Status int32
const (
	SubscribeJobResponse_NoJob  SubscribeJobResponse_Status = 0
	SubscribeJobResponse_NewJob SubscribeJobResponse_Status = 1
)

func (SubscribeJobResponse_Status) EnumDescriptor

func (SubscribeJobResponse_Status) EnumDescriptor() ([]byte, []int)

func (SubscribeJobResponse_Status) String

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 NewLoomServer

func NewLoomServer(svc Loom, hooks *twirp.ServerHooks) TwirpServer

Jump to

Keyboard shortcuts

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