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
- Variables
- func WriteError(resp http.ResponseWriter, err error)
- type ComponentUpgrade
- func (*ComponentUpgrade) Descriptor() ([]byte, []int)
- func (m *ComponentUpgrade) GetImage() *Image
- func (m *ComponentUpgrade) GetImageMissingList() []*Image
- func (m *ComponentUpgrade) GetIsReverify() bool
- func (m *ComponentUpgrade) GetIssueType() ComponentUpgrade_IssueType
- func (m *ComponentUpgrade) GetName() string
- func (m *ComponentUpgrade) GetNamespace() string
- func (m *ComponentUpgrade) GetQueueHistoryName() string
- func (m *ComponentUpgrade) GetReverificationStatus() ComponentUpgrade_ReverificationStatus
- func (m *ComponentUpgrade) GetRuns() int32
- func (m *ComponentUpgrade) GetStatus() ComponentUpgrade_UpgradeStatus
- func (m *ComponentUpgrade) GetTeamName() string
- func (m *ComponentUpgrade) GetTestBuildTypeID() string
- func (*ComponentUpgrade) ProtoMessage()
- func (m *ComponentUpgrade) Reset()
- func (m *ComponentUpgrade) String() string
- func (m *ComponentUpgrade) XXX_DiscardUnknown()
- func (m *ComponentUpgrade) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ComponentUpgrade) XXX_Merge(src proto.Message)
- func (m *ComponentUpgrade) XXX_Size() int
- func (m *ComponentUpgrade) XXX_Unmarshal(b []byte) error
- type ComponentUpgrade_IssueType
- type ComponentUpgrade_ReverificationStatus
- type ComponentUpgrade_UpgradeStatus
- type Configuration
- func (*Configuration) Descriptor() ([]byte, []int)
- func (m *Configuration) GetConfig() []byte
- func (m *Configuration) GetGitRevision() string
- func (*Configuration) ProtoMessage()
- func (m *Configuration) Reset()
- func (m *Configuration) String() string
- func (m *Configuration) XXX_DiscardUnknown()
- func (m *Configuration) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Configuration) XXX_Merge(src proto.Message)
- func (m *Configuration) XXX_Size() int
- func (m *Configuration) XXX_Unmarshal(b []byte) error
- type Empty
- func (*Empty) Descriptor() ([]byte, []int)
- func (*Empty) ProtoMessage()
- func (m *Empty) Reset()
- func (m *Empty) String() string
- func (m *Empty) XXX_DiscardUnknown()
- func (m *Empty) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Empty) XXX_Merge(src proto.Message)
- func (m *Empty) XXX_Size() int
- func (m *Empty) XXX_Unmarshal(b []byte) error
- type HTTPClient
- type Image
- func (*Image) Descriptor() ([]byte, []int)
- func (m *Image) GetRepository() string
- func (m *Image) GetTag() string
- func (*Image) ProtoMessage()
- func (m *Image) Reset()
- func (m *Image) String() string
- func (m *Image) XXX_DiscardUnknown()
- func (m *Image) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Image) XXX_Merge(src proto.Message)
- func (m *Image) XXX_Size() int
- func (m *Image) XXX_Unmarshal(b []byte) error
- type ImageList
- func (*ImageList) Descriptor() ([]byte, []int)
- func (m *ImageList) GetImages() []*Image
- func (*ImageList) ProtoMessage()
- func (m *ImageList) Reset()
- func (m *ImageList) String() string
- func (m *ImageList) XXX_DiscardUnknown()
- func (m *ImageList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ImageList) XXX_Merge(src proto.Message)
- func (m *ImageList) XXX_Size() int
- func (m *ImageList) XXX_Unmarshal(b []byte) error
- type RPC
- type Team
- func (*Team) Descriptor() ([]byte, []int)
- func (m *Team) GetName() string
- func (*Team) ProtoMessage()
- func (m *Team) Reset()
- func (m *Team) String() string
- func (m *Team) XXX_DiscardUnknown()
- func (m *Team) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Team) XXX_Merge(src proto.Message)
- func (m *Team) XXX_Size() int
- func (m *Team) XXX_Unmarshal(b []byte) error
- type TeamWithCurrentComponent
- func (*TeamWithCurrentComponent) Descriptor() ([]byte, []int)
- func (m *TeamWithCurrentComponent) GetCompName() string
- func (m *TeamWithCurrentComponent) GetImage() *Image
- func (m *TeamWithCurrentComponent) GetTeamName() string
- func (*TeamWithCurrentComponent) ProtoMessage()
- func (m *TeamWithCurrentComponent) Reset()
- func (m *TeamWithCurrentComponent) String() string
- func (m *TeamWithCurrentComponent) XXX_DiscardUnknown()
- func (m *TeamWithCurrentComponent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *TeamWithCurrentComponent) XXX_Merge(src proto.Message)
- func (m *TeamWithCurrentComponent) XXX_Size() int
- func (m *TeamWithCurrentComponent) XXX_Unmarshal(b []byte) error
- type TwirpServer
Constants ¶
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 ¶
var ComponentUpgrade_IssueType_name = map[int32]string{
0: "IssueType_UNKNOWN",
1: "IssueType_DESIRED_VERSION_FAILED",
2: "IssueType_IMAGE_MISSING",
3: "IssueType_ENVIRONMENT_ISSUE",
}
var ComponentUpgrade_IssueType_value = map[string]int32{
"IssueType_UNKNOWN": 0,
"IssueType_DESIRED_VERSION_FAILED": 1,
"IssueType_IMAGE_MISSING": 2,
"IssueType_ENVIRONMENT_ISSUE": 3,
}
var ComponentUpgrade_ReverificationStatus_name = map[int32]string{
0: "ReverificationStatus_UNKNOWN",
1: "ReverificationStatus_FAILURE",
2: "ReverificationStatus_SUCCESS",
}
var ComponentUpgrade_ReverificationStatus_value = map[string]int32{
"ReverificationStatus_UNKNOWN": 0,
"ReverificationStatus_FAILURE": 1,
"ReverificationStatus_SUCCESS": 2,
}
var ComponentUpgrade_UpgradeStatus_name = map[int32]string{
0: "UpgradeStatus_FAILURE",
1: "UpgradeStatus_SUCCESS",
}
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 (m *ComponentUpgrade) GetStatus() ComponentUpgrade_UpgradeStatus
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 ¶
func (x ComponentUpgrade_IssueType) String() 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 ¶
func (x ComponentUpgrade_ReverificationStatus) String() 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 ¶
func (x ComponentUpgrade_UpgradeStatus) String() string
type Configuration ¶
type Configuration struct { Config []byte `protobuf:"bytes,1,opt,name=config,proto3" json:"config,omitempty"` GitRevision string `protobuf:"bytes,2,opt,name=gitRevision,proto3" json:"gitRevision,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*Configuration) Descriptor ¶
func (*Configuration) Descriptor() ([]byte, []int)
func (*Configuration) GetConfig ¶
func (m *Configuration) GetConfig() []byte
func (*Configuration) GetGitRevision ¶
func (m *Configuration) GetGitRevision() string
func (*Configuration) ProtoMessage ¶
func (*Configuration) ProtoMessage()
func (*Configuration) Reset ¶
func (m *Configuration) Reset()
func (*Configuration) String ¶
func (m *Configuration) String() string
func (*Configuration) XXX_DiscardUnknown ¶
func (m *Configuration) XXX_DiscardUnknown()
func (*Configuration) XXX_Marshal ¶
func (m *Configuration) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*Configuration) XXX_Merge ¶
func (m *Configuration) XXX_Merge(src proto.Message)
func (*Configuration) XXX_Size ¶
func (m *Configuration) XXX_Size() int
func (*Configuration) XXX_Unmarshal ¶
func (m *Configuration) XXX_Unmarshal(b []byte) error
type Empty ¶
type Empty struct { XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*Empty) Descriptor ¶
func (*Empty) ProtoMessage ¶
func (*Empty) ProtoMessage()
func (*Empty) XXX_DiscardUnknown ¶
func (m *Empty) XXX_DiscardUnknown()
func (*Empty) XXX_Marshal ¶
func (*Empty) XXX_Unmarshal ¶
type HTTPClient ¶
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) GetRepository ¶
func (*Image) ProtoMessage ¶
func (*Image) ProtoMessage()
func (*Image) XXX_DiscardUnknown ¶
func (m *Image) XXX_DiscardUnknown()
func (*Image) XXX_Marshal ¶
func (*Image) XXX_Unmarshal ¶
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) ProtoMessage ¶
func (*ImageList) ProtoMessage()
func (*ImageList) XXX_DiscardUnknown ¶
func (m *ImageList) XXX_DiscardUnknown()
func (*ImageList) XXX_Marshal ¶
func (*ImageList) XXX_Unmarshal ¶
type RPC ¶
type RPC interface { GetConfiguration(context.Context, *Team) (*Configuration, error) 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) ProtoMessage ¶
func (*Team) ProtoMessage()
func (*Team) XXX_DiscardUnknown ¶
func (m *Team) XXX_DiscardUnknown()
func (*Team) XXX_Unmarshal ¶
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