rpc

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2020 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package rpc 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:

pkg/samsahai/rpc/service.proto

Index

Constants

View Source
const RPCPathPrefix = "/twirp/samsahai.io.samsahai.RPC/"

RPCPathPrefix is used for all URL paths on a twirp RPC server. Requests are always: POST RPCPathPrefix/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 ComponentUpgrade_IssueType_name = map[int32]string{
	0: "IssueType_UNKNOWN",
	1: "IssueType_DESIRED_VERSION_FAILED",
	2: "IssueType_IMAGE_MISSING",
	3: "IssueType_ENVIRONMENT_ISSUE",
}
View Source
var ComponentUpgrade_IssueType_value = map[string]int32{
	"IssueType_UNKNOWN":                0,
	"IssueType_DESIRED_VERSION_FAILED": 1,
	"IssueType_IMAGE_MISSING":          2,
	"IssueType_ENVIRONMENT_ISSUE":      3,
}
View Source
var ComponentUpgrade_ReverificationStatus_name = map[int32]string{
	0: "ReverificationStatus_UNKNOWN",
	1: "ReverificationStatus_FAILURE",
	2: "ReverificationStatus_SUCCESS",
}
View Source
var ComponentUpgrade_ReverificationStatus_value = map[string]int32{
	"ReverificationStatus_UNKNOWN": 0,
	"ReverificationStatus_FAILURE": 1,
	"ReverificationStatus_SUCCESS": 2,
}
View Source
var ComponentUpgrade_UpgradeStatus_name = map[int32]string{
	0: "UpgradeStatus_FAILURE",
	1: "UpgradeStatus_SUCCESS",
}
View Source
var ComponentUpgrade_UpgradeStatus_value = map[string]int32{
	"UpgradeStatus_FAILURE": 0,
	"UpgradeStatus_SUCCESS": 1,
}

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 ComponentUpgrade

type ComponentUpgrade struct {
	Status               ComponentUpgrade_UpgradeStatus        `protobuf:"varint,1,opt,name=status,proto3,enum=samsahai.io.samsahai.ComponentUpgrade_UpgradeStatus" json:"status,omitempty"`
	Name                 string                                `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	TeamName             string                                `protobuf:"bytes,3,opt,name=teamName,proto3" json:"teamName,omitempty"`
	Image                *Image                                `protobuf:"bytes,4,opt,name=image,proto3" json:"image,omitempty"`
	IssueType            ComponentUpgrade_IssueType            `protobuf:"varint,5,opt,name=issueType,proto3,enum=samsahai.io.samsahai.ComponentUpgrade_IssueType" json:"issueType,omitempty"`
	QueueHistoryName     string                                `protobuf:"bytes,6,opt,name=queueHistoryName,proto3" json:"queueHistoryName,omitempty"`
	ImageMissingList     []*Image                              `protobuf:"bytes,7,rep,name=imageMissingList,proto3" json:"imageMissingList,omitempty"`
	Namespace            string                                `protobuf:"bytes,8,opt,name=namespace,proto3" json:"namespace,omitempty"`
	TestBuildTypeID      string                                `protobuf:"bytes,9,opt,name=testBuildTypeID,proto3" json:"testBuildTypeID,omitempty"`
	Runs                 int32                                 `protobuf:"varint,10,opt,name=runs,proto3" json:"runs,omitempty"`
	IsReverify           bool                                  `protobuf:"varint,11,opt,name=isReverify,proto3" json:"isReverify,omitempty"`
	ReverificationStatus ComponentUpgrade_ReverificationStatus `` /* 159-byte string literal not displayed */
	XXX_NoUnkeyedLiteral struct{}                              `json:"-"`
	XXX_unrecognized     []byte                                `json:"-"`
	XXX_sizecache        int32                                 `json:"-"`
}

func (*ComponentUpgrade) Descriptor

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

func (*ComponentUpgrade) GetImage

func (m *ComponentUpgrade) GetImage() *Image

func (*ComponentUpgrade) GetImageMissingList

func (m *ComponentUpgrade) GetImageMissingList() []*Image

func (*ComponentUpgrade) GetIsReverify

func (m *ComponentUpgrade) GetIsReverify() bool

func (*ComponentUpgrade) GetIssueType

func (m *ComponentUpgrade) GetIssueType() ComponentUpgrade_IssueType

func (*ComponentUpgrade) GetName

func (m *ComponentUpgrade) GetName() string

func (*ComponentUpgrade) GetNamespace

func (m *ComponentUpgrade) GetNamespace() string

func (*ComponentUpgrade) GetQueueHistoryName

func (m *ComponentUpgrade) GetQueueHistoryName() string

func (*ComponentUpgrade) GetReverificationStatus

func (m *ComponentUpgrade) GetReverificationStatus() ComponentUpgrade_ReverificationStatus

func (*ComponentUpgrade) GetRuns

func (m *ComponentUpgrade) GetRuns() int32

func (*ComponentUpgrade) GetStatus

func (*ComponentUpgrade) GetTeamName

func (m *ComponentUpgrade) GetTeamName() string

func (*ComponentUpgrade) GetTestBuildTypeID

func (m *ComponentUpgrade) GetTestBuildTypeID() string

func (*ComponentUpgrade) ProtoMessage

func (*ComponentUpgrade) ProtoMessage()

func (*ComponentUpgrade) Reset

func (m *ComponentUpgrade) Reset()

func (*ComponentUpgrade) String

func (m *ComponentUpgrade) String() string

func (*ComponentUpgrade) XXX_DiscardUnknown

func (m *ComponentUpgrade) XXX_DiscardUnknown()

func (*ComponentUpgrade) XXX_Marshal

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

func (*ComponentUpgrade) XXX_Merge

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

func (*ComponentUpgrade) XXX_Size

func (m *ComponentUpgrade) XXX_Size() int

func (*ComponentUpgrade) XXX_Unmarshal

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

type ComponentUpgrade_IssueType

type ComponentUpgrade_IssueType int32
const (
	ComponentUpgrade_IssueType_UNKNOWN                ComponentUpgrade_IssueType = 0
	ComponentUpgrade_IssueType_DESIRED_VERSION_FAILED ComponentUpgrade_IssueType = 1
	ComponentUpgrade_IssueType_IMAGE_MISSING          ComponentUpgrade_IssueType = 2
	ComponentUpgrade_IssueType_ENVIRONMENT_ISSUE      ComponentUpgrade_IssueType = 3
)

func (ComponentUpgrade_IssueType) EnumDescriptor

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

func (ComponentUpgrade_IssueType) String

type ComponentUpgrade_ReverificationStatus

type ComponentUpgrade_ReverificationStatus int32
const (
	ComponentUpgrade_ReverificationStatus_UNKNOWN ComponentUpgrade_ReverificationStatus = 0
	ComponentUpgrade_ReverificationStatus_FAILURE ComponentUpgrade_ReverificationStatus = 1
	ComponentUpgrade_ReverificationStatus_SUCCESS ComponentUpgrade_ReverificationStatus = 2
)

func (ComponentUpgrade_ReverificationStatus) EnumDescriptor

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

func (ComponentUpgrade_ReverificationStatus) String

type ComponentUpgrade_UpgradeStatus

type ComponentUpgrade_UpgradeStatus int32
const (
	ComponentUpgrade_UpgradeStatus_FAILURE ComponentUpgrade_UpgradeStatus = 0
	ComponentUpgrade_UpgradeStatus_SUCCESS ComponentUpgrade_UpgradeStatus = 1
)

func (ComponentUpgrade_UpgradeStatus) EnumDescriptor

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

func (ComponentUpgrade_UpgradeStatus) String

type Empty

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

func (*Empty) Descriptor

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

func (*Empty) ProtoMessage

func (*Empty) ProtoMessage()

func (*Empty) Reset

func (m *Empty) Reset()

func (*Empty) String

func (m *Empty) String() string

func (*Empty) XXX_DiscardUnknown

func (m *Empty) XXX_DiscardUnknown()

func (*Empty) XXX_Marshal

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

func (*Empty) XXX_Merge

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

func (*Empty) XXX_Size

func (m *Empty) XXX_Size() int

func (*Empty) XXX_Unmarshal

func (m *Empty) 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 Image

type Image struct {
	Repository           string   `protobuf:"bytes,1,opt,name=repository,proto3" json:"repository,omitempty"`
	Tag                  string   `protobuf:"bytes,2,opt,name=tag,proto3" json:"tag,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Image) Descriptor

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

func (*Image) GetRepository

func (m *Image) GetRepository() string

func (*Image) GetTag

func (m *Image) GetTag() string

func (*Image) ProtoMessage

func (*Image) ProtoMessage()

func (*Image) Reset

func (m *Image) Reset()

func (*Image) String

func (m *Image) String() string

func (*Image) XXX_DiscardUnknown

func (m *Image) XXX_DiscardUnknown()

func (*Image) XXX_Marshal

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

func (*Image) XXX_Merge

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

func (*Image) XXX_Size

func (m *Image) XXX_Size() int

func (*Image) XXX_Unmarshal

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

type ImageList

type ImageList struct {
	Images               []*Image `protobuf:"bytes,1,rep,name=images,proto3" json:"images,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*ImageList) Descriptor

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

func (*ImageList) GetImages

func (m *ImageList) GetImages() []*Image

func (*ImageList) ProtoMessage

func (*ImageList) ProtoMessage()

func (*ImageList) Reset

func (m *ImageList) Reset()

func (*ImageList) String

func (m *ImageList) String() string

func (*ImageList) XXX_DiscardUnknown

func (m *ImageList) XXX_DiscardUnknown()

func (*ImageList) XXX_Marshal

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

func (*ImageList) XXX_Merge

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

func (*ImageList) XXX_Size

func (m *ImageList) XXX_Size() int

func (*ImageList) XXX_Unmarshal

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

type RPC

type RPC interface {
	RunPostComponentUpgrade(context.Context, *ComponentUpgrade) (*Empty, error)

	GetMissingVersion(context.Context, *TeamWithCurrentComponent) (*ImageList, error)

	SendUpdateStateQueueMetric(context.Context, *ComponentUpgrade) (*Empty, error)
}

func NewRPCJSONClient

func NewRPCJSONClient(addr string, client HTTPClient, opts ...twirp.ClientOption) RPC

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

func NewRPCProtobufClient

func NewRPCProtobufClient(addr string, client HTTPClient, opts ...twirp.ClientOption) RPC

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

type Team

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

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

func (*Team) GetName

func (m *Team) GetName() string

func (*Team) ProtoMessage

func (*Team) ProtoMessage()

func (*Team) Reset

func (m *Team) Reset()

func (*Team) String

func (m *Team) String() string

func (*Team) XXX_DiscardUnknown

func (m *Team) XXX_DiscardUnknown()

func (*Team) XXX_Marshal

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

func (*Team) XXX_Merge

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

func (*Team) XXX_Size

func (m *Team) XXX_Size() int

func (*Team) XXX_Unmarshal

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

type TeamWithCurrentComponent

type TeamWithCurrentComponent struct {
	TeamName             string   `protobuf:"bytes,1,opt,name=teamName,proto3" json:"teamName,omitempty"`
	CompName             string   `protobuf:"bytes,2,opt,name=compName,proto3" json:"compName,omitempty"`
	Image                *Image   `protobuf:"bytes,3,opt,name=image,proto3" json:"image,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*TeamWithCurrentComponent) Descriptor

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

func (*TeamWithCurrentComponent) GetCompName

func (m *TeamWithCurrentComponent) GetCompName() string

func (*TeamWithCurrentComponent) GetImage

func (m *TeamWithCurrentComponent) GetImage() *Image

func (*TeamWithCurrentComponent) GetTeamName

func (m *TeamWithCurrentComponent) GetTeamName() string

func (*TeamWithCurrentComponent) ProtoMessage

func (*TeamWithCurrentComponent) ProtoMessage()

func (*TeamWithCurrentComponent) Reset

func (m *TeamWithCurrentComponent) Reset()

func (*TeamWithCurrentComponent) String

func (m *TeamWithCurrentComponent) String() string

func (*TeamWithCurrentComponent) XXX_DiscardUnknown

func (m *TeamWithCurrentComponent) XXX_DiscardUnknown()

func (*TeamWithCurrentComponent) XXX_Marshal

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

func (*TeamWithCurrentComponent) XXX_Merge

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

func (*TeamWithCurrentComponent) XXX_Size

func (m *TeamWithCurrentComponent) XXX_Size() int

func (*TeamWithCurrentComponent) XXX_Unmarshal

func (m *TeamWithCurrentComponent) 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 NewRPCServer

func NewRPCServer(svc RPC, hooks *twirp.ServerHooks) TwirpServer

Jump to

Keyboard shortcuts

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