agent

package
v0.8.11 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2021 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

Package agent is a generated twirp stub package. This code was generated with github.com/twitchtv/twirp/protoc-gen-twirp v7.1.1.

It is generated from these files:

agent.proto

Index

Constants

View Source
const AgentActionPathPrefix = "/twirp/redsail.bosn.AgentAction/"

AgentActionPathPrefix is a convenience constant that could used to identify URL paths. Should be used with caution, it only matches routes generated by Twirp Go clients, that add a "/twirp" prefix by default, and use CamelCase service and method names. More info: https://twitchtv.github.io/twirp/docs/routing.html

View Source
const AgentPathPrefix = "/twirp/redsail.bosn.Agent/"

AgentPathPrefix is a convenience constant that could used to identify URL paths. Should be used with caution, it only matches routes generated by Twirp Go clients, that add a "/twirp" prefix by default, and use CamelCase service and method names. More info: https://twitchtv.github.io/twirp/docs/routing.html

Variables

View Source
var (
	ActionType_name = map[int32]string{
		0: "HELM_ACTION",
		1: "KUBE_ACTION",
	}
	ActionType_value = map[string]int32{
		"HELM_ACTION": 0,
		"KUBE_ACTION": 1,
	}
)

Enum value maps for ActionType.

View Source
var File_agent_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 Action

type Action struct {
	Uuid           string     `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"`
	ClusterUuid    string     `protobuf:"bytes,2,opt,name=cluster_uuid,json=clusterUuid,proto3" json:"cluster_uuid,omitempty"`
	ClusterToken   string     `protobuf:"bytes,3,opt,name=cluster_token,json=clusterToken,proto3" json:"cluster_token,omitempty"`
	ActionType     ActionType `protobuf:"varint,4,opt,name=action_type,json=actionType,proto3,enum=redsail.bosn.ActionType" json:"action_type,omitempty"`
	Action         string     `protobuf:"bytes,5,opt,name=action,proto3" json:"action,omitempty"`
	TimeoutSeconds int64      `protobuf:"varint,6,opt,name=timeout_seconds,json=timeoutSeconds,proto3" json:"timeout_seconds,omitempty"`
	Args           []byte     `protobuf:"bytes,7,opt,name=args,proto3" json:"args,omitempty"`
	// contains filtered or unexported fields
}

func (*Action) Descriptor deprecated

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

Deprecated: Use Action.ProtoReflect.Descriptor instead.

func (*Action) GetAction

func (x *Action) GetAction() string

func (*Action) GetActionType

func (x *Action) GetActionType() ActionType

func (*Action) GetArgs

func (x *Action) GetArgs() []byte

func (*Action) GetClusterToken

func (x *Action) GetClusterToken() string

func (*Action) GetClusterUuid

func (x *Action) GetClusterUuid() string

func (*Action) GetTimeoutSeconds

func (x *Action) GetTimeoutSeconds() int64

func (*Action) GetUuid

func (x *Action) GetUuid() string

func (*Action) ProtoMessage

func (*Action) ProtoMessage()

func (*Action) ProtoReflect

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

func (*Action) Reset

func (x *Action) Reset()

func (*Action) String

func (x *Action) String() string

type ActionType

type ActionType int32
const (
	ActionType_HELM_ACTION ActionType = 0
	ActionType_KUBE_ACTION ActionType = 1
)

func (ActionType) Descriptor

func (ActionType) Descriptor() protoreflect.EnumDescriptor

func (ActionType) Enum

func (x ActionType) Enum() *ActionType

func (ActionType) EnumDescriptor deprecated

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

Deprecated: Use ActionType.Descriptor instead.

func (ActionType) Number

func (x ActionType) Number() protoreflect.EnumNumber

func (ActionType) String

func (x ActionType) String() string

func (ActionType) Type

type ActionsRead

type ActionsRead struct {
	Actions []*Action `protobuf:"bytes,1,rep,name=actions,proto3" json:"actions,omitempty"`
	// contains filtered or unexported fields
}

func (*ActionsRead) Descriptor deprecated

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

Deprecated: Use ActionsRead.ProtoReflect.Descriptor instead.

func (*ActionsRead) GetActions

func (x *ActionsRead) GetActions() []*Action

func (*ActionsRead) ProtoMessage

func (*ActionsRead) ProtoMessage()

func (*ActionsRead) ProtoReflect

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

func (*ActionsRead) Reset

func (x *ActionsRead) Reset()

func (*ActionsRead) String

func (x *ActionsRead) String() string

type Agent

type Agent interface {
	// gets the next action for the agent or an empty list if there's nothing to do
	Actions(context.Context, *ReadActions) (*ActionsRead, error)

	// returns a result for this agent
	Results(context.Context, *ReturnResult) (*ResultReturned, error)
}

func NewAgentJSONClient

func NewAgentJSONClient(baseURL string, client HTTPClient, opts ...twirp.ClientOption) Agent

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

func NewAgentProtobufClient

func NewAgentProtobufClient(baseURL string, client HTTPClient, opts ...twirp.ClientOption) Agent

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

type AgentAction

type AgentAction interface {
	Run(context.Context, *Action) (*Result, error)
}

func NewAgentActionJSONClient

func NewAgentActionJSONClient(baseURL string, client HTTPClient, opts ...twirp.ClientOption) AgentAction

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

func NewAgentActionProtobufClient

func NewAgentActionProtobufClient(baseURL string, client HTTPClient, opts ...twirp.ClientOption) AgentAction

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

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 ReadActions

type ReadActions struct {
	ClusterUuid  string `protobuf:"bytes,1,opt,name=cluster_uuid,json=clusterUuid,proto3" json:"cluster_uuid,omitempty"`
	ClusterToken string `protobuf:"bytes,2,opt,name=cluster_token,json=clusterToken,proto3" json:"cluster_token,omitempty"`
	// contains filtered or unexported fields
}

func (*ReadActions) Descriptor deprecated

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

Deprecated: Use ReadActions.ProtoReflect.Descriptor instead.

func (*ReadActions) GetClusterToken

func (x *ReadActions) GetClusterToken() string

func (*ReadActions) GetClusterUuid

func (x *ReadActions) GetClusterUuid() string

func (*ReadActions) ProtoMessage

func (*ReadActions) ProtoMessage()

func (*ReadActions) ProtoReflect

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

func (*ReadActions) Reset

func (x *ReadActions) Reset()

func (*ReadActions) String

func (x *ReadActions) String() string

type Result

type Result struct {
	Data  []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
	Error string `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"`
	// contains filtered or unexported fields
}

func (*Result) Descriptor deprecated

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

Deprecated: Use Result.ProtoReflect.Descriptor instead.

func (*Result) GetData

func (x *Result) GetData() []byte

func (*Result) GetError

func (x *Result) GetError() string

func (*Result) ProtoMessage

func (*Result) ProtoMessage()

func (*Result) ProtoReflect

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

func (*Result) Reset

func (x *Result) Reset()

func (*Result) String

func (x *Result) String() string

type ResultReturned

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

func (*ResultReturned) Descriptor deprecated

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

Deprecated: Use ResultReturned.ProtoReflect.Descriptor instead.

func (*ResultReturned) ProtoMessage

func (*ResultReturned) ProtoMessage()

func (*ResultReturned) ProtoReflect

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

func (*ResultReturned) Reset

func (x *ResultReturned) Reset()

func (*ResultReturned) String

func (x *ResultReturned) String() string

type ReturnResult

type ReturnResult struct {
	ActionUuid   string  `protobuf:"bytes,1,opt,name=action_uuid,json=actionUuid,proto3" json:"action_uuid,omitempty"`
	ClusterUuid  string  `protobuf:"bytes,2,opt,name=cluster_uuid,json=clusterUuid,proto3" json:"cluster_uuid,omitempty"`
	ClusterToken string  `protobuf:"bytes,3,opt,name=cluster_token,json=clusterToken,proto3" json:"cluster_token,omitempty"`
	Result       *Result `protobuf:"bytes,4,opt,name=result,proto3" json:"result,omitempty"`
	// contains filtered or unexported fields
}

func (*ReturnResult) Descriptor deprecated

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

Deprecated: Use ReturnResult.ProtoReflect.Descriptor instead.

func (*ReturnResult) GetActionUuid

func (x *ReturnResult) GetActionUuid() string

func (*ReturnResult) GetClusterToken

func (x *ReturnResult) GetClusterToken() string

func (*ReturnResult) GetClusterUuid

func (x *ReturnResult) GetClusterUuid() string

func (*ReturnResult) GetResult

func (x *ReturnResult) GetResult() *Result

func (*ReturnResult) ProtoMessage

func (*ReturnResult) ProtoMessage()

func (*ReturnResult) ProtoReflect

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

func (*ReturnResult) Reset

func (x *ReturnResult) Reset()

func (*ReturnResult) String

func (x *ReturnResult) 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.
	// The path prefix is in the form: "/<prefix>/<package>.<Service>/"
	// that is, everything in a Twirp route except for the <Method> at the end.
	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 NewAgentActionServer

func NewAgentActionServer(svc AgentAction, opts ...interface{}) TwirpServer

NewAgentActionServer builds a TwirpServer that can be used as an http.Handler to handle HTTP requests that are routed to the right method in the provided svc implementation. The opts are twirp.ServerOption modifiers, for example twirp.WithServerHooks(hooks).

func NewAgentServer

func NewAgentServer(svc Agent, opts ...interface{}) TwirpServer

NewAgentServer builds a TwirpServer that can be used as an http.Handler to handle HTTP requests that are routed to the right method in the provided svc implementation. The opts are twirp.ServerOption modifiers, for example twirp.WithServerHooks(hooks).

Jump to

Keyboard shortcuts

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