rpc

package
v1.6.1 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2020 License: Apache-2.0 Imports: 18 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.11.0.

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_UpgradeStatus_name = map[int32]string{
		0: "UpgradeStatus_FAILURE",
		1: "UpgradeStatus_SUCCESS",
	}
	ComponentUpgrade_UpgradeStatus_value = map[string]int32{
		"UpgradeStatus_FAILURE": 0,
		"UpgradeStatus_SUCCESS": 1,
	}
)

Enum value maps for ComponentUpgrade_UpgradeStatus.

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",
	}
	ComponentUpgrade_IssueType_value = map[string]int32{
		"IssueType_UNKNOWN":                0,
		"IssueType_DESIRED_VERSION_FAILED": 1,
		"IssueType_IMAGE_MISSING":          2,
		"IssueType_ENVIRONMENT_ISSUE":      3,
	}
)

Enum value maps for ComponentUpgrade_IssueType.

View Source
var (
	ComponentUpgrade_ReverificationStatus_name = map[int32]string{
		0: "ReverificationStatus_UNKNOWN",
		1: "ReverificationStatus_FAILURE",
		2: "ReverificationStatus_SUCCESS",
	}
	ComponentUpgrade_ReverificationStatus_value = map[string]int32{
		"ReverificationStatus_UNKNOWN": 0,
		"ReverificationStatus_FAILURE": 1,
		"ReverificationStatus_SUCCESS": 2,
	}
)

Enum value maps for ComponentUpgrade_ReverificationStatus.

View Source
var File_pkg_samsahai_rpc_service_proto protoreflect.FileDescriptor

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 BundleName added in v1.4.0

type BundleName struct {
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// contains filtered or unexported fields
}

func (*BundleName) Descriptor deprecated added in v1.4.0

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

Deprecated: Use BundleName.ProtoReflect.Descriptor instead.

func (*BundleName) GetName added in v1.4.0

func (x *BundleName) GetName() string

func (*BundleName) ProtoMessage added in v1.4.0

func (*BundleName) ProtoMessage()

func (*BundleName) ProtoReflect added in v1.4.0

func (x *BundleName) ProtoReflect() protoreflect.Message

func (*BundleName) Reset added in v1.4.0

func (x *BundleName) Reset()

func (*BundleName) String added in v1.4.0

func (x *BundleName) String() string

type Component added in v1.4.0

type Component struct {
	Name  string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Image *Image `protobuf:"bytes,2,opt,name=image,proto3" json:"image,omitempty"`
	// contains filtered or unexported fields
}

func (*Component) Descriptor deprecated added in v1.4.0

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

Deprecated: Use Component.ProtoReflect.Descriptor instead.

func (*Component) GetImage added in v1.4.0

func (x *Component) GetImage() *Image

func (*Component) GetName added in v1.4.0

func (x *Component) GetName() string

func (*Component) ProtoMessage added in v1.4.0

func (*Component) ProtoMessage()

func (*Component) ProtoReflect added in v1.4.0

func (x *Component) ProtoReflect() protoreflect.Message

func (*Component) Reset added in v1.4.0

func (x *Component) Reset()

func (*Component) String added in v1.4.0

func (x *Component) String() string

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"`
	Components           []*Component                          `protobuf:"bytes,4,rep,name=components,proto3" json:"components,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 */
	DeploymentIssues     []*DeploymentIssue                    `protobuf:"bytes,13,rep,name=deploymentIssues,proto3" json:"deploymentIssues,omitempty"`
	// contains filtered or unexported fields
}

func (*ComponentUpgrade) Descriptor deprecated

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

Deprecated: Use ComponentUpgrade.ProtoReflect.Descriptor instead.

func (*ComponentUpgrade) GetComponents added in v1.4.0

func (x *ComponentUpgrade) GetComponents() []*Component

func (*ComponentUpgrade) GetDeploymentIssues added in v1.6.0

func (x *ComponentUpgrade) GetDeploymentIssues() []*DeploymentIssue

func (*ComponentUpgrade) GetImageMissingList

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

func (*ComponentUpgrade) GetIsReverify

func (x *ComponentUpgrade) GetIsReverify() bool

func (*ComponentUpgrade) GetIssueType

func (x *ComponentUpgrade) GetIssueType() ComponentUpgrade_IssueType

func (*ComponentUpgrade) GetName

func (x *ComponentUpgrade) GetName() string

func (*ComponentUpgrade) GetNamespace

func (x *ComponentUpgrade) GetNamespace() string

func (*ComponentUpgrade) GetQueueHistoryName

func (x *ComponentUpgrade) GetQueueHistoryName() string

func (*ComponentUpgrade) GetReverificationStatus

func (x *ComponentUpgrade) GetReverificationStatus() ComponentUpgrade_ReverificationStatus

func (*ComponentUpgrade) GetRuns

func (x *ComponentUpgrade) GetRuns() int32

func (*ComponentUpgrade) GetStatus

func (*ComponentUpgrade) GetTeamName

func (x *ComponentUpgrade) GetTeamName() string

func (*ComponentUpgrade) GetTestBuildTypeID

func (x *ComponentUpgrade) GetTestBuildTypeID() string

func (*ComponentUpgrade) ProtoMessage

func (*ComponentUpgrade) ProtoMessage()

func (*ComponentUpgrade) ProtoReflect added in v1.4.0

func (x *ComponentUpgrade) ProtoReflect() protoreflect.Message

func (*ComponentUpgrade) Reset

func (x *ComponentUpgrade) Reset()

func (*ComponentUpgrade) String

func (x *ComponentUpgrade) String() string

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) Descriptor added in v1.4.0

func (ComponentUpgrade_IssueType) Enum added in v1.4.0

func (ComponentUpgrade_IssueType) EnumDescriptor deprecated

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

Deprecated: Use ComponentUpgrade_IssueType.Descriptor instead.

func (ComponentUpgrade_IssueType) Number added in v1.4.0

func (ComponentUpgrade_IssueType) String

func (ComponentUpgrade_IssueType) Type added in v1.4.0

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) Descriptor added in v1.4.0

func (ComponentUpgrade_ReverificationStatus) Enum added in v1.4.0

func (ComponentUpgrade_ReverificationStatus) EnumDescriptor deprecated

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

Deprecated: Use ComponentUpgrade_ReverificationStatus.Descriptor instead.

func (ComponentUpgrade_ReverificationStatus) Number added in v1.4.0

func (ComponentUpgrade_ReverificationStatus) String

func (ComponentUpgrade_ReverificationStatus) Type added in v1.4.0

type ComponentUpgrade_UpgradeStatus

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

func (ComponentUpgrade_UpgradeStatus) Descriptor added in v1.4.0

func (ComponentUpgrade_UpgradeStatus) Enum added in v1.4.0

func (ComponentUpgrade_UpgradeStatus) EnumDescriptor deprecated

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

Deprecated: Use ComponentUpgrade_UpgradeStatus.Descriptor instead.

func (ComponentUpgrade_UpgradeStatus) Number added in v1.4.0

func (ComponentUpgrade_UpgradeStatus) String

func (ComponentUpgrade_UpgradeStatus) Type added in v1.4.0

type DeploymentIssue added in v1.6.0

type DeploymentIssue struct {
	IssueType         string              `protobuf:"bytes,1,opt,name=issueType,proto3" json:"issueType,omitempty"`
	FailureComponents []*FailureComponent `protobuf:"bytes,2,rep,name=failureComponents,proto3" json:"failureComponents,omitempty"`
	// contains filtered or unexported fields
}

func (*DeploymentIssue) Descriptor deprecated added in v1.6.0

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

Deprecated: Use DeploymentIssue.ProtoReflect.Descriptor instead.

func (*DeploymentIssue) GetFailureComponents added in v1.6.0

func (x *DeploymentIssue) GetFailureComponents() []*FailureComponent

func (*DeploymentIssue) GetIssueType added in v1.6.0

func (x *DeploymentIssue) GetIssueType() string

func (*DeploymentIssue) ProtoMessage added in v1.6.0

func (*DeploymentIssue) ProtoMessage()

func (*DeploymentIssue) ProtoReflect added in v1.6.0

func (x *DeploymentIssue) ProtoReflect() protoreflect.Message

func (*DeploymentIssue) Reset added in v1.6.0

func (x *DeploymentIssue) Reset()

func (*DeploymentIssue) String added in v1.6.0

func (x *DeploymentIssue) String() string

type Empty

type Empty struct {
	// contains filtered or unexported fields
}

func (*Empty) Descriptor deprecated

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

Deprecated: Use Empty.ProtoReflect.Descriptor instead.

func (*Empty) ProtoMessage

func (*Empty) ProtoMessage()

func (*Empty) ProtoReflect added in v1.4.0

func (x *Empty) ProtoReflect() protoreflect.Message

func (*Empty) Reset

func (x *Empty) Reset()

func (*Empty) String

func (x *Empty) String() string

type FailureComponent added in v1.6.0

type FailureComponent struct {
	ComponentName             string `protobuf:"bytes,1,opt,name=componentName,proto3" json:"componentName,omitempty"`
	FirstFailureContainerName string `protobuf:"bytes,2,opt,name=firstFailureContainerName,proto3" json:"firstFailureContainerName,omitempty"`
	RestartCount              int32  `protobuf:"varint,3,opt,name=restartCount,proto3" json:"restartCount,omitempty"`
	NodeName                  string `protobuf:"bytes,4,opt,name=nodeName,proto3" json:"nodeName,omitempty"`
	// contains filtered or unexported fields
}

func (*FailureComponent) Descriptor deprecated added in v1.6.0

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

Deprecated: Use FailureComponent.ProtoReflect.Descriptor instead.

func (*FailureComponent) GetComponentName added in v1.6.0

func (x *FailureComponent) GetComponentName() string

func (*FailureComponent) GetFirstFailureContainerName added in v1.6.0

func (x *FailureComponent) GetFirstFailureContainerName() string

func (*FailureComponent) GetNodeName added in v1.6.0

func (x *FailureComponent) GetNodeName() string

func (*FailureComponent) GetRestartCount added in v1.6.0

func (x *FailureComponent) GetRestartCount() int32

func (*FailureComponent) ProtoMessage added in v1.6.0

func (*FailureComponent) ProtoMessage()

func (*FailureComponent) ProtoReflect added in v1.6.0

func (x *FailureComponent) ProtoReflect() protoreflect.Message

func (*FailureComponent) Reset added in v1.6.0

func (x *FailureComponent) Reset()

func (*FailureComponent) String added in v1.6.0

func (x *FailureComponent) 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 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"`
	// contains filtered or unexported fields
}

func (*Image) Descriptor deprecated

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

Deprecated: Use Image.ProtoReflect.Descriptor instead.

func (*Image) GetRepository

func (x *Image) GetRepository() string

func (*Image) GetTag

func (x *Image) GetTag() string

func (*Image) ProtoMessage

func (*Image) ProtoMessage()

func (*Image) ProtoReflect added in v1.4.0

func (x *Image) ProtoReflect() protoreflect.Message

func (*Image) Reset

func (x *Image) Reset()

func (*Image) String

func (x *Image) String() string

type ImageList

type ImageList struct {
	Images []*Image `protobuf:"bytes,1,rep,name=images,proto3" json:"images,omitempty"`
	// contains filtered or unexported fields
}

func (*ImageList) Descriptor deprecated

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

Deprecated: Use ImageList.ProtoReflect.Descriptor instead.

func (*ImageList) GetImages

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

func (*ImageList) ProtoMessage

func (*ImageList) ProtoMessage()

func (*ImageList) ProtoReflect added in v1.4.0

func (x *ImageList) ProtoReflect() protoreflect.Message

func (*ImageList) Reset

func (x *ImageList) Reset()

func (*ImageList) String

func (x *ImageList) String() string

type PriorityQueues added in v1.4.3

type PriorityQueues struct {
	Queues []string `protobuf:"bytes,1,rep,name=queues,proto3" json:"queues,omitempty"`
	// contains filtered or unexported fields
}

func (*PriorityQueues) Descriptor deprecated added in v1.4.3

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

Deprecated: Use PriorityQueues.ProtoReflect.Descriptor instead.

func (*PriorityQueues) GetQueues added in v1.4.3

func (x *PriorityQueues) GetQueues() []string

func (*PriorityQueues) ProtoMessage added in v1.4.3

func (*PriorityQueues) ProtoMessage()

func (*PriorityQueues) ProtoReflect added in v1.4.3

func (x *PriorityQueues) ProtoReflect() protoreflect.Message

func (*PriorityQueues) Reset added in v1.4.3

func (x *PriorityQueues) Reset()

func (*PriorityQueues) String added in v1.4.3

func (x *PriorityQueues) String() string

type RPC

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

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

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

	GetBundleName(context.Context, *TeamWithComponentName) (*BundleName, error)

	GetPriorityQueues(context.Context, *TeamName) (*PriorityQueues, 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 TeamName added in v1.4.3

type TeamName struct {
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// contains filtered or unexported fields
}

func (*TeamName) Descriptor deprecated added in v1.4.3

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

Deprecated: Use TeamName.ProtoReflect.Descriptor instead.

func (*TeamName) GetName added in v1.4.3

func (x *TeamName) GetName() string

func (*TeamName) ProtoMessage added in v1.4.3

func (*TeamName) ProtoMessage()

func (*TeamName) ProtoReflect added in v1.4.3

func (x *TeamName) ProtoReflect() protoreflect.Message

func (*TeamName) Reset added in v1.4.3

func (x *TeamName) Reset()

func (*TeamName) String added in v1.4.3

func (x *TeamName) String() string

type TeamWithComponentName added in v1.4.0

type TeamWithComponentName struct {
	TeamName      string `protobuf:"bytes,1,opt,name=teamName,proto3" json:"teamName,omitempty"`
	ComponentName string `protobuf:"bytes,2,opt,name=componentName,proto3" json:"componentName,omitempty"`
	// contains filtered or unexported fields
}

func (*TeamWithComponentName) Descriptor deprecated added in v1.4.0

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

Deprecated: Use TeamWithComponentName.ProtoReflect.Descriptor instead.

func (*TeamWithComponentName) GetComponentName added in v1.4.0

func (x *TeamWithComponentName) GetComponentName() string

func (*TeamWithComponentName) GetTeamName added in v1.4.0

func (x *TeamWithComponentName) GetTeamName() string

func (*TeamWithComponentName) ProtoMessage added in v1.4.0

func (*TeamWithComponentName) ProtoMessage()

func (*TeamWithComponentName) ProtoReflect added in v1.4.0

func (x *TeamWithComponentName) ProtoReflect() protoreflect.Message

func (*TeamWithComponentName) Reset added in v1.4.0

func (x *TeamWithComponentName) Reset()

func (*TeamWithComponentName) String added in v1.4.0

func (x *TeamWithComponentName) String() string

type TeamWithCurrentComponent

type TeamWithCurrentComponent struct {
	TeamName   string       `protobuf:"bytes,1,opt,name=teamName,proto3" json:"teamName,omitempty"`
	Components []*Component `protobuf:"bytes,2,rep,name=components,proto3" json:"components,omitempty"`
	// contains filtered or unexported fields
}

func (*TeamWithCurrentComponent) Descriptor deprecated

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

Deprecated: Use TeamWithCurrentComponent.ProtoReflect.Descriptor instead.

func (*TeamWithCurrentComponent) GetComponents added in v1.4.0

func (x *TeamWithCurrentComponent) GetComponents() []*Component

func (*TeamWithCurrentComponent) GetTeamName

func (x *TeamWithCurrentComponent) GetTeamName() string

func (*TeamWithCurrentComponent) ProtoMessage

func (*TeamWithCurrentComponent) ProtoMessage()

func (*TeamWithCurrentComponent) ProtoReflect added in v1.4.0

func (x *TeamWithCurrentComponent) ProtoReflect() protoreflect.Message

func (*TeamWithCurrentComponent) Reset

func (x *TeamWithCurrentComponent) Reset()

func (*TeamWithCurrentComponent) String

func (x *TeamWithCurrentComponent) 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
	// 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