pb

package
v0.0.0-...-a52efcf Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2018 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package pb is a generated protocol buffer package.

It is generated from these files:

services/event/transport/pb/event.proto

It has these top-level messages:

EventObj
CreateRequest
CreateResponse
GetRequest
GetResponse
UpdateRequest
UpdateResponse
DeleteRequest
DeleteResponse
ListRequest
ListResponse

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

It is generated from these files:

services/event/transport/pb/event.proto

Index

Constants

View Source
const EventPathPrefix = "/twirp/pb.Event/"

EventPathPrefix is used for all URL paths on a twirp Event server. Requests are always: POST EventPathPrefix/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 RegisterEventServer

func RegisterEventServer(s *grpc.Server, srv EventServer)

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 CreateRequest

type CreateRequest struct {
	TenantId []byte    `protobuf:"bytes,1,opt,name=tenant_id,json=tenantId,proto3" json:"tenant_id,omitempty"`
	Event    *EventObj `protobuf:"bytes,2,opt,name=event" json:"event,omitempty"`
}

func (*CreateRequest) Descriptor

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

func (*CreateRequest) GetEvent

func (m *CreateRequest) GetEvent() *EventObj

func (*CreateRequest) GetTenantId

func (m *CreateRequest) GetTenantId() []byte

func (*CreateRequest) ProtoMessage

func (*CreateRequest) ProtoMessage()

func (*CreateRequest) Reset

func (m *CreateRequest) Reset()

func (*CreateRequest) String

func (m *CreateRequest) String() string

type CreateResponse

type CreateResponse struct {
	Id []byte `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
}

func (*CreateResponse) Descriptor

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

func (*CreateResponse) GetId

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

func (*CreateResponse) ProtoMessage

func (*CreateResponse) ProtoMessage()

func (*CreateResponse) Reset

func (m *CreateResponse) Reset()

func (*CreateResponse) String

func (m *CreateResponse) String() string

type DeleteRequest

type DeleteRequest struct {
	TenantId []byte `protobuf:"bytes,1,opt,name=tenant_id,json=tenantId,proto3" json:"tenant_id,omitempty"`
	Id       []byte `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"`
}

func (*DeleteRequest) Descriptor

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

func (*DeleteRequest) GetId

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

func (*DeleteRequest) GetTenantId

func (m *DeleteRequest) GetTenantId() []byte

func (*DeleteRequest) ProtoMessage

func (*DeleteRequest) ProtoMessage()

func (*DeleteRequest) Reset

func (m *DeleteRequest) Reset()

func (*DeleteRequest) String

func (m *DeleteRequest) String() string

type DeleteResponse

type DeleteResponse struct {
}

func (*DeleteResponse) Descriptor

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

func (*DeleteResponse) ProtoMessage

func (*DeleteResponse) ProtoMessage()

func (*DeleteResponse) Reset

func (m *DeleteResponse) Reset()

func (*DeleteResponse) String

func (m *DeleteResponse) String() string

type Event

func NewEventJSONClient

func NewEventJSONClient(addr string, client HTTPClient) Event

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

func NewEventProtobufClient

func NewEventProtobufClient(addr string, client HTTPClient) Event

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

type EventClient

type EventClient interface {
	Create(ctx context.Context, in *CreateRequest, opts ...grpc.CallOption) (*CreateResponse, error)
	Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error)
	Update(ctx context.Context, in *UpdateRequest, opts ...grpc.CallOption) (*UpdateResponse, error)
	Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*DeleteResponse, error)
	List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ListResponse, error)
}

func NewEventClient

func NewEventClient(cc *grpc.ClientConn) EventClient

type EventObj

type EventObj struct {
	Id   []byte `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Name string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"`
}

func (*EventObj) Descriptor

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

func (*EventObj) GetId

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

func (*EventObj) GetName

func (m *EventObj) GetName() string

func (*EventObj) ProtoMessage

func (*EventObj) ProtoMessage()

func (*EventObj) Reset

func (m *EventObj) Reset()

func (*EventObj) String

func (m *EventObj) String() string

type GetRequest

type GetRequest struct {
	TenantId []byte `protobuf:"bytes,1,opt,name=tenant_id,json=tenantId,proto3" json:"tenant_id,omitempty"`
	Id       []byte `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"`
}

func (*GetRequest) Descriptor

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

func (*GetRequest) GetId

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

func (*GetRequest) GetTenantId

func (m *GetRequest) GetTenantId() []byte

func (*GetRequest) ProtoMessage

func (*GetRequest) ProtoMessage()

func (*GetRequest) Reset

func (m *GetRequest) Reset()

func (*GetRequest) String

func (m *GetRequest) String() string

type GetResponse

type GetResponse struct {
	Event *EventObj `protobuf:"bytes,1,opt,name=event" json:"event,omitempty"`
}

func (*GetResponse) Descriptor

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

func (*GetResponse) GetEvent

func (m *GetResponse) GetEvent() *EventObj

func (*GetResponse) ProtoMessage

func (*GetResponse) ProtoMessage()

func (*GetResponse) Reset

func (m *GetResponse) Reset()

func (*GetResponse) String

func (m *GetResponse) String() string

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 ListRequest

type ListRequest struct {
	TenantId []byte `protobuf:"bytes,1,opt,name=tenant_id,json=tenantId,proto3" json:"tenant_id,omitempty"`
}

func (*ListRequest) Descriptor

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

func (*ListRequest) GetTenantId

func (m *ListRequest) GetTenantId() []byte

func (*ListRequest) ProtoMessage

func (*ListRequest) ProtoMessage()

func (*ListRequest) Reset

func (m *ListRequest) Reset()

func (*ListRequest) String

func (m *ListRequest) String() string

type ListResponse

type ListResponse struct {
	Events []*EventObj `protobuf:"bytes,1,rep,name=events" json:"events,omitempty"`
}

func (*ListResponse) Descriptor

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

func (*ListResponse) GetEvents

func (m *ListResponse) GetEvents() []*EventObj

func (*ListResponse) ProtoMessage

func (*ListResponse) ProtoMessage()

func (*ListResponse) Reset

func (m *ListResponse) Reset()

func (*ListResponse) String

func (m *ListResponse) String() 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 NewEventServer

func NewEventServer(svc Event, hooks *twirp.ServerHooks) TwirpServer

type UpdateRequest

type UpdateRequest struct {
	TenantId []byte    `protobuf:"bytes,1,opt,name=tenant_id,json=tenantId,proto3" json:"tenant_id,omitempty"`
	Event    *EventObj `protobuf:"bytes,2,opt,name=event" json:"event,omitempty"`
}

func (*UpdateRequest) Descriptor

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

func (*UpdateRequest) GetEvent

func (m *UpdateRequest) GetEvent() *EventObj

func (*UpdateRequest) GetTenantId

func (m *UpdateRequest) GetTenantId() []byte

func (*UpdateRequest) ProtoMessage

func (*UpdateRequest) ProtoMessage()

func (*UpdateRequest) Reset

func (m *UpdateRequest) Reset()

func (*UpdateRequest) String

func (m *UpdateRequest) String() string

type UpdateResponse

type UpdateResponse struct {
}

func (*UpdateResponse) Descriptor

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

func (*UpdateResponse) ProtoMessage

func (*UpdateResponse) ProtoMessage()

func (*UpdateResponse) Reset

func (m *UpdateResponse) Reset()

func (*UpdateResponse) String

func (m *UpdateResponse) String() string

Jump to

Keyboard shortcuts

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