e2e

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2020 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

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

It is generated from these files:

service.proto

Index

Constants

View Source
const ServicePathPrefix = "/twirp/e2e.Service/"

ServicePathPrefix is used for all URL paths on a twirp Service server. Requests are always: POST ServicePathPrefix/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 TrafficLight_name = map[int32]string{
	0: "RED",
	1: "YELLOW",
	2: "GREEN",
}
View Source
var TrafficLight_value = map[string]int32{
	"RED":    0,
	"YELLOW": 1,
	"GREEN":  2,
}

Functions

func WriteError

func WriteError(resp http.ResponseWriter, err error)

WriteError writes an HTTP response with a valid Twirp error format (code, msg, meta). Useful outside of the Twirp server (e.g. http middleware), but does not trigger hooks. If err is not a twirp.Error, it will get wrapped with twirp.InternalErrorWith(err)

Types

type BreadReq

type BreadReq struct {
	Count                int64    `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*BreadReq) Descriptor

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

func (*BreadReq) GetCount

func (m *BreadReq) GetCount() int64

func (*BreadReq) ProtoMessage

func (*BreadReq) ProtoMessage()

func (*BreadReq) Reset

func (m *BreadReq) Reset()

func (*BreadReq) String

func (m *BreadReq) String() string

func (*BreadReq) XXX_DiscardUnknown

func (m *BreadReq) XXX_DiscardUnknown()

func (*BreadReq) XXX_Marshal

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

func (*BreadReq) XXX_Merge

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

func (*BreadReq) XXX_Size

func (m *BreadReq) XXX_Size() int

func (*BreadReq) XXX_Unmarshal

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

type BreadResp

type BreadResp struct {
	// Types that are valid to be assigned to Answer:
	//	*BreadResp_Name
	//	*BreadResp_Toasted
	Answer               isBreadResp_Answer `protobuf_oneof:"answer"`
	XXX_NoUnkeyedLiteral struct{}           `json:"-"`
	XXX_unrecognized     []byte             `json:"-"`
	XXX_sizecache        int32              `json:"-"`
}

func (*BreadResp) Descriptor

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

func (*BreadResp) GetAnswer

func (m *BreadResp) GetAnswer() isBreadResp_Answer

func (*BreadResp) GetName

func (m *BreadResp) GetName() string

func (*BreadResp) GetToasted

func (m *BreadResp) GetToasted() bool

func (*BreadResp) ProtoMessage

func (*BreadResp) ProtoMessage()

func (*BreadResp) Reset

func (m *BreadResp) Reset()

func (*BreadResp) String

func (m *BreadResp) String() string

func (*BreadResp) XXX_DiscardUnknown

func (m *BreadResp) XXX_DiscardUnknown()

func (*BreadResp) XXX_Marshal

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

func (*BreadResp) XXX_Merge

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

func (*BreadResp) XXX_OneofWrappers

func (*BreadResp) XXX_OneofWrappers() []interface{}

XXX_OneofWrappers is for the internal use of the proto package.

func (*BreadResp) XXX_Size

func (m *BreadResp) XXX_Size() int

func (*BreadResp) XXX_Unmarshal

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

type BreadResp_Name

type BreadResp_Name struct {
	Name string `protobuf:"bytes,1,opt,name=name,proto3,oneof"`
}

type BreadResp_Toasted

type BreadResp_Toasted struct {
	Toasted bool `protobuf:"varint,2,opt,name=toasted,proto3,oneof"`
}

type ChangeMeReq

type ChangeMeReq struct {
	Name                 string                   `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Previous             map[string]*ChangeMeResp `` /* 157-byte string literal not displayed */
	XXX_NoUnkeyedLiteral struct{}                 `json:"-"`
	XXX_unrecognized     []byte                   `json:"-"`
	XXX_sizecache        int32                    `json:"-"`
}

func (*ChangeMeReq) Descriptor

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

func (*ChangeMeReq) GetName

func (m *ChangeMeReq) GetName() string

func (*ChangeMeReq) GetPrevious

func (m *ChangeMeReq) GetPrevious() map[string]*ChangeMeResp

func (*ChangeMeReq) ProtoMessage

func (*ChangeMeReq) ProtoMessage()

func (*ChangeMeReq) Reset

func (m *ChangeMeReq) Reset()

func (*ChangeMeReq) String

func (m *ChangeMeReq) String() string

func (*ChangeMeReq) XXX_DiscardUnknown

func (m *ChangeMeReq) XXX_DiscardUnknown()

func (*ChangeMeReq) XXX_Marshal

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

func (*ChangeMeReq) XXX_Merge

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

func (*ChangeMeReq) XXX_Size

func (m *ChangeMeReq) XXX_Size() int

func (*ChangeMeReq) XXX_Unmarshal

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

type ChangeMeResp

type ChangeMeResp struct {
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// Types that are valid to be assigned to Answer:
	//	*ChangeMeResp_NewName
	//	*ChangeMeResp_Changed
	Answer               isChangeMeResp_Answer    `protobuf_oneof:"answer"`
	Previous             map[string]*ChangeMeResp `` /* 157-byte string literal not displayed */
	XXX_NoUnkeyedLiteral struct{}                 `json:"-"`
	XXX_unrecognized     []byte                   `json:"-"`
	XXX_sizecache        int32                    `json:"-"`
}

func (*ChangeMeResp) Descriptor

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

func (*ChangeMeResp) GetAnswer

func (m *ChangeMeResp) GetAnswer() isChangeMeResp_Answer

func (*ChangeMeResp) GetChanged

func (m *ChangeMeResp) GetChanged() bool

func (*ChangeMeResp) GetName

func (m *ChangeMeResp) GetName() string

func (*ChangeMeResp) GetNewName

func (m *ChangeMeResp) GetNewName() string

func (*ChangeMeResp) GetPrevious

func (m *ChangeMeResp) GetPrevious() map[string]*ChangeMeResp

func (*ChangeMeResp) ProtoMessage

func (*ChangeMeResp) ProtoMessage()

func (*ChangeMeResp) Reset

func (m *ChangeMeResp) Reset()

func (*ChangeMeResp) String

func (m *ChangeMeResp) String() string

func (*ChangeMeResp) XXX_DiscardUnknown

func (m *ChangeMeResp) XXX_DiscardUnknown()

func (*ChangeMeResp) XXX_Marshal

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

func (*ChangeMeResp) XXX_Merge

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

func (*ChangeMeResp) XXX_OneofWrappers

func (*ChangeMeResp) XXX_OneofWrappers() []interface{}

XXX_OneofWrappers is for the internal use of the proto package.

func (*ChangeMeResp) XXX_Size

func (m *ChangeMeResp) XXX_Size() int

func (*ChangeMeResp) XXX_Unmarshal

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

type ChangeMeResp_Changed

type ChangeMeResp_Changed struct {
	Changed bool `protobuf:"varint,3,opt,name=changed,proto3,oneof"`
}

type ChangeMeResp_NewName

type ChangeMeResp_NewName struct {
	NewName string `protobuf:"bytes,2,opt,name=newName,proto3,oneof"`
}

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 HelloReq

type HelloReq 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 (*HelloReq) Descriptor

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

func (*HelloReq) GetName

func (m *HelloReq) GetName() string

func (*HelloReq) ProtoMessage

func (*HelloReq) ProtoMessage()

func (*HelloReq) Reset

func (m *HelloReq) Reset()

func (*HelloReq) String

func (m *HelloReq) String() string

func (*HelloReq) XXX_DiscardUnknown

func (m *HelloReq) XXX_DiscardUnknown()

func (*HelloReq) XXX_Marshal

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

func (*HelloReq) XXX_Merge

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

func (*HelloReq) XXX_Size

func (m *HelloReq) XXX_Size() int

func (*HelloReq) XXX_Unmarshal

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

type HelloResp

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

func (*HelloResp) Descriptor

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

func (*HelloResp) GetText

func (m *HelloResp) GetText() string

func (*HelloResp) ProtoMessage

func (*HelloResp) ProtoMessage()

func (*HelloResp) Reset

func (m *HelloResp) Reset()

func (*HelloResp) String

func (m *HelloResp) String() string

func (*HelloResp) XXX_DiscardUnknown

func (m *HelloResp) XXX_DiscardUnknown()

func (*HelloResp) XXX_Marshal

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

func (*HelloResp) XXX_Merge

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

func (*HelloResp) XXX_Size

func (m *HelloResp) XXX_Size() int

func (*HelloResp) XXX_Unmarshal

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

type PaintersReq

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

func (*PaintersReq) Descriptor

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

func (*PaintersReq) ProtoMessage

func (*PaintersReq) ProtoMessage()

func (*PaintersReq) Reset

func (m *PaintersReq) Reset()

func (*PaintersReq) String

func (m *PaintersReq) String() string

func (*PaintersReq) XXX_DiscardUnknown

func (m *PaintersReq) XXX_DiscardUnknown()

func (*PaintersReq) XXX_Marshal

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

func (*PaintersReq) XXX_Merge

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

func (*PaintersReq) XXX_Size

func (m *PaintersReq) XXX_Size() int

func (*PaintersReq) XXX_Unmarshal

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

type PaintersResp

type PaintersResp struct {
	BestPainter          *painters.Painter `protobuf:"bytes,1,opt,name=bestPainter,proto3" json:"bestPainter,omitempty"`
	AllPainters          []string          `protobuf:"bytes,2,rep,name=allPainters,proto3" json:"allPainters,omitempty"`
	XXX_NoUnkeyedLiteral struct{}          `json:"-"`
	XXX_unrecognized     []byte            `json:"-"`
	XXX_sizecache        int32             `json:"-"`
}

func (*PaintersResp) Descriptor

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

func (*PaintersResp) GetAllPainters

func (m *PaintersResp) GetAllPainters() []string

func (*PaintersResp) GetBestPainter

func (m *PaintersResp) GetBestPainter() *painters.Painter

func (*PaintersResp) ProtoMessage

func (*PaintersResp) ProtoMessage()

func (*PaintersResp) Reset

func (m *PaintersResp) Reset()

func (*PaintersResp) String

func (m *PaintersResp) String() string

func (*PaintersResp) XXX_DiscardUnknown

func (m *PaintersResp) XXX_DiscardUnknown()

func (*PaintersResp) XXX_Marshal

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

func (*PaintersResp) XXX_Merge

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

func (*PaintersResp) XXX_Size

func (m *PaintersResp) XXX_Size() int

func (*PaintersResp) XXX_Unmarshal

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

type Service

func NewServiceJSONClient

func NewServiceJSONClient(addr string, client HTTPClient, opts ...twirp.ClientOption) Service

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

func NewServiceProtobufClient

func NewServiceProtobufClient(addr string, client HTTPClient, opts ...twirp.ClientOption) Service

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

type TrafficJamReq

type TrafficJamReq struct {
	Color                TrafficLight   `protobuf:"varint,1,opt,name=color,proto3,enum=e2e.TrafficLight" json:"color,omitempty"`
	TrafficLights        []TrafficLight `protobuf:"varint,2,rep,packed,name=trafficLights,proto3,enum=e2e.TrafficLight" json:"trafficLights,omitempty"`
	XXX_NoUnkeyedLiteral struct{}       `json:"-"`
	XXX_unrecognized     []byte         `json:"-"`
	XXX_sizecache        int32          `json:"-"`
}

func (*TrafficJamReq) Descriptor

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

func (*TrafficJamReq) GetColor

func (m *TrafficJamReq) GetColor() TrafficLight

func (*TrafficJamReq) GetTrafficLights added in v0.7.0

func (m *TrafficJamReq) GetTrafficLights() []TrafficLight

func (*TrafficJamReq) ProtoMessage

func (*TrafficJamReq) ProtoMessage()

func (*TrafficJamReq) Reset

func (m *TrafficJamReq) Reset()

func (*TrafficJamReq) String

func (m *TrafficJamReq) String() string

func (*TrafficJamReq) XXX_DiscardUnknown

func (m *TrafficJamReq) XXX_DiscardUnknown()

func (*TrafficJamReq) XXX_Marshal

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

func (*TrafficJamReq) XXX_Merge

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

func (*TrafficJamReq) XXX_Size

func (m *TrafficJamReq) XXX_Size() int

func (*TrafficJamReq) XXX_Unmarshal

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

type TrafficJamResp

type TrafficJamResp struct {
	Next                 TrafficLight `protobuf:"varint,1,opt,name=next,proto3,enum=e2e.TrafficLight" json:"next,omitempty"`
	XXX_NoUnkeyedLiteral struct{}     `json:"-"`
	XXX_unrecognized     []byte       `json:"-"`
	XXX_sizecache        int32        `json:"-"`
}

func (*TrafficJamResp) Descriptor

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

func (*TrafficJamResp) GetNext

func (m *TrafficJamResp) GetNext() TrafficLight

func (*TrafficJamResp) ProtoMessage

func (*TrafficJamResp) ProtoMessage()

func (*TrafficJamResp) Reset

func (m *TrafficJamResp) Reset()

func (*TrafficJamResp) String

func (m *TrafficJamResp) String() string

func (*TrafficJamResp) XXX_DiscardUnknown

func (m *TrafficJamResp) XXX_DiscardUnknown()

func (*TrafficJamResp) XXX_Marshal

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

func (*TrafficJamResp) XXX_Merge

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

func (*TrafficJamResp) XXX_Size

func (m *TrafficJamResp) XXX_Size() int

func (*TrafficJamResp) XXX_Unmarshal

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

type TrafficLight

type TrafficLight int32
const (
	TrafficLight_RED    TrafficLight = 0
	TrafficLight_YELLOW TrafficLight = 1
	TrafficLight_GREEN  TrafficLight = 2
)

func (TrafficLight) EnumDescriptor

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

func (TrafficLight) String

func (x TrafficLight) String() string

type TranslateReq

type TranslateReq struct {
	Words                map[string]*Word `` /* 151-byte string literal not displayed */
	XXX_NoUnkeyedLiteral struct{}         `json:"-"`
	XXX_unrecognized     []byte           `json:"-"`
	XXX_sizecache        int32            `json:"-"`
}

func (*TranslateReq) Descriptor

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

func (*TranslateReq) GetWords

func (m *TranslateReq) GetWords() map[string]*Word

func (*TranslateReq) ProtoMessage

func (*TranslateReq) ProtoMessage()

func (*TranslateReq) Reset

func (m *TranslateReq) Reset()

func (*TranslateReq) String

func (m *TranslateReq) String() string

func (*TranslateReq) XXX_DiscardUnknown

func (m *TranslateReq) XXX_DiscardUnknown()

func (*TranslateReq) XXX_Marshal

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

func (*TranslateReq) XXX_Merge

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

func (*TranslateReq) XXX_Size

func (m *TranslateReq) XXX_Size() int

func (*TranslateReq) XXX_Unmarshal

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

type TranslateResp

type TranslateResp struct {
	Translations         map[string]*Word `` /* 165-byte string literal not displayed */
	XXX_NoUnkeyedLiteral struct{}         `json:"-"`
	XXX_unrecognized     []byte           `json:"-"`
	XXX_sizecache        int32            `json:"-"`
}

func (*TranslateResp) Descriptor

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

func (*TranslateResp) GetTranslations

func (m *TranslateResp) GetTranslations() map[string]*Word

func (*TranslateResp) ProtoMessage

func (*TranslateResp) ProtoMessage()

func (*TranslateResp) Reset

func (m *TranslateResp) Reset()

func (*TranslateResp) String

func (m *TranslateResp) String() string

func (*TranslateResp) XXX_DiscardUnknown

func (m *TranslateResp) XXX_DiscardUnknown()

func (*TranslateResp) XXX_Marshal

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

func (*TranslateResp) XXX_Merge

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

func (*TranslateResp) XXX_Size

func (m *TranslateResp) XXX_Size() int

func (*TranslateResp) XXX_Unmarshal

func (m *TranslateResp) 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
	// PathPrefix returns the HTTP URL path prefix for all methods handled by this
	// service. This can be used with an HTTP mux to route twirp requests
	// alongside non-twirp requests on one HTTP listener.
	PathPrefix() 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 NewServiceServer

func NewServiceServer(svc Service, hooks *twirp.ServerHooks) TwirpServer

type Word

type Word struct {
	Word                 string   `protobuf:"bytes,1,opt,name=word,proto3" json:"word,omitempty"`
	Language             string   `protobuf:"bytes,2,opt,name=language,proto3" json:"language,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Word) Descriptor

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

func (*Word) GetLanguage

func (m *Word) GetLanguage() string

func (*Word) GetWord

func (m *Word) GetWord() string

func (*Word) ProtoMessage

func (*Word) ProtoMessage()

func (*Word) Reset

func (m *Word) Reset()

func (*Word) String

func (m *Word) String() string

func (*Word) XXX_DiscardUnknown

func (m *Word) XXX_DiscardUnknown()

func (*Word) XXX_Marshal

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

func (*Word) XXX_Merge

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

func (*Word) XXX_Size

func (m *Word) XXX_Size() int

func (*Word) XXX_Unmarshal

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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