cluster

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 cluster 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:

cluster.proto

Index

Constants

View Source
const ClusterPathPrefix = "/twirp/redsail.bosn.Cluster/"

ClusterPathPrefix 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 File_cluster_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 Cluster

type Cluster interface {
	// adds a cluster to the list of configurations
	Create(context.Context, *CreateCluster) (*ClusterCreated, error)

	// edits an already existing cluster
	Update(context.Context, *UpdateCluster) (*ClusterUpdated, error)

	// removes a cluster from the list of configurations
	Destroy(context.Context, *DestroyCluster) (*ClusterDestroyed, error)

	// reads out a cluster
	Read(context.Context, *ReadCluster) (*ClusterRead, error)

	// gets all clusters currently configured and their status
	All(context.Context, *ReadClusters) (*ClustersRead, error)

	// gets the cluster's access token
	Token(context.Context, *ReadClusterToken) (*ClusterTokenRead, error)
}

func NewClusterJSONClient

func NewClusterJSONClient(baseURL string, client HTTPClient, opts ...twirp.ClientOption) Cluster

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

func NewClusterProtobufClient

func NewClusterProtobufClient(baseURL string, client HTTPClient, opts ...twirp.ClientOption) Cluster

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

type ClusterCreated

type ClusterCreated struct {
	Uuid string `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"` // the uuid of the cluster, used when setting up the agent
	// contains filtered or unexported fields
}

func (*ClusterCreated) Descriptor deprecated

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

Deprecated: Use ClusterCreated.ProtoReflect.Descriptor instead.

func (*ClusterCreated) GetUuid added in v0.6.0

func (x *ClusterCreated) GetUuid() string

func (*ClusterCreated) ProtoMessage

func (*ClusterCreated) ProtoMessage()

func (*ClusterCreated) ProtoReflect

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

func (*ClusterCreated) Reset

func (x *ClusterCreated) Reset()

func (*ClusterCreated) String

func (x *ClusterCreated) String() string

type ClusterDestroyed

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

func (*ClusterDestroyed) Descriptor deprecated

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

Deprecated: Use ClusterDestroyed.ProtoReflect.Descriptor instead.

func (*ClusterDestroyed) ProtoMessage

func (*ClusterDestroyed) ProtoMessage()

func (*ClusterDestroyed) ProtoReflect

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

func (*ClusterDestroyed) Reset

func (x *ClusterDestroyed) Reset()

func (*ClusterDestroyed) String

func (x *ClusterDestroyed) String() string

type ClusterRead

type ClusterRead struct {
	Uuid  string `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"`    // unique id of the cluster
	Name  string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`    // name of the cluster
	Ready bool   `protobuf:"varint,3,opt,name=ready,proto3" json:"ready,omitempty"` // server ready status, based on agent status
	// contains filtered or unexported fields
}

func (*ClusterRead) Descriptor deprecated

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

Deprecated: Use ClusterRead.ProtoReflect.Descriptor instead.

func (*ClusterRead) GetName

func (x *ClusterRead) GetName() string

func (*ClusterRead) GetReady

func (x *ClusterRead) GetReady() bool

func (*ClusterRead) GetUuid

func (x *ClusterRead) GetUuid() string

func (*ClusterRead) ProtoMessage

func (*ClusterRead) ProtoMessage()

func (*ClusterRead) ProtoReflect

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

func (*ClusterRead) Reset

func (x *ClusterRead) Reset()

func (*ClusterRead) String

func (x *ClusterRead) String() string

type ClusterTokenRead added in v0.8.4

type ClusterTokenRead struct {
	Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` // the token for this cluster
	// contains filtered or unexported fields
}

func (*ClusterTokenRead) Descriptor deprecated added in v0.8.4

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

Deprecated: Use ClusterTokenRead.ProtoReflect.Descriptor instead.

func (*ClusterTokenRead) GetToken added in v0.8.4

func (x *ClusterTokenRead) GetToken() string

func (*ClusterTokenRead) ProtoMessage added in v0.8.4

func (*ClusterTokenRead) ProtoMessage()

func (*ClusterTokenRead) ProtoReflect added in v0.8.4

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

func (*ClusterTokenRead) Reset added in v0.8.4

func (x *ClusterTokenRead) Reset()

func (*ClusterTokenRead) String added in v0.8.4

func (x *ClusterTokenRead) String() string

type ClusterUpdated

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

func (*ClusterUpdated) Descriptor deprecated

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

Deprecated: Use ClusterUpdated.ProtoReflect.Descriptor instead.

func (*ClusterUpdated) ProtoMessage

func (*ClusterUpdated) ProtoMessage()

func (*ClusterUpdated) ProtoReflect

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

func (*ClusterUpdated) Reset

func (x *ClusterUpdated) Reset()

func (*ClusterUpdated) String

func (x *ClusterUpdated) String() string

type ClustersRead

type ClustersRead struct {
	Clusters []*ClusterRead `protobuf:"bytes,1,rep,name=clusters,proto3" json:"clusters,omitempty"` // clusters read
	// contains filtered or unexported fields
}

func (*ClustersRead) Descriptor deprecated

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

Deprecated: Use ClustersRead.ProtoReflect.Descriptor instead.

func (*ClustersRead) GetClusters

func (x *ClustersRead) GetClusters() []*ClusterRead

func (*ClustersRead) ProtoMessage

func (*ClustersRead) ProtoMessage()

func (*ClustersRead) ProtoReflect

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

func (*ClustersRead) Reset

func (x *ClustersRead) Reset()

func (*ClustersRead) String

func (x *ClustersRead) String() string

type CreateCluster

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

func (*CreateCluster) Descriptor deprecated

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

Deprecated: Use CreateCluster.ProtoReflect.Descriptor instead.

func (*CreateCluster) GetName

func (x *CreateCluster) GetName() string

func (*CreateCluster) ProtoMessage

func (*CreateCluster) ProtoMessage()

func (*CreateCluster) ProtoReflect

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

func (*CreateCluster) Reset

func (x *CreateCluster) Reset()

func (*CreateCluster) String

func (x *CreateCluster) String() string

type DestroyCluster

type DestroyCluster struct {
	Uuid string `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"` // unique id of the cluster
	// contains filtered or unexported fields
}

func (*DestroyCluster) Descriptor deprecated

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

Deprecated: Use DestroyCluster.ProtoReflect.Descriptor instead.

func (*DestroyCluster) GetUuid

func (x *DestroyCluster) GetUuid() string

func (*DestroyCluster) ProtoMessage

func (*DestroyCluster) ProtoMessage()

func (*DestroyCluster) ProtoReflect

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

func (*DestroyCluster) Reset

func (x *DestroyCluster) Reset()

func (*DestroyCluster) String

func (x *DestroyCluster) 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 ReadCluster

type ReadCluster struct {
	Uuid string `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"` // unique id of the cluster
	// contains filtered or unexported fields
}

func (*ReadCluster) Descriptor deprecated

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

Deprecated: Use ReadCluster.ProtoReflect.Descriptor instead.

func (*ReadCluster) GetUuid

func (x *ReadCluster) GetUuid() string

func (*ReadCluster) ProtoMessage

func (*ReadCluster) ProtoMessage()

func (*ReadCluster) ProtoReflect

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

func (*ReadCluster) Reset

func (x *ReadCluster) Reset()

func (*ReadCluster) String

func (x *ReadCluster) String() string

type ReadClusterToken added in v0.8.4

type ReadClusterToken struct {
	Uuid string `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"` //unique id of the cluster
	// contains filtered or unexported fields
}

func (*ReadClusterToken) Descriptor deprecated added in v0.8.4

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

Deprecated: Use ReadClusterToken.ProtoReflect.Descriptor instead.

func (*ReadClusterToken) GetUuid added in v0.8.4

func (x *ReadClusterToken) GetUuid() string

func (*ReadClusterToken) ProtoMessage added in v0.8.4

func (*ReadClusterToken) ProtoMessage()

func (*ReadClusterToken) ProtoReflect added in v0.8.4

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

func (*ReadClusterToken) Reset added in v0.8.4

func (x *ReadClusterToken) Reset()

func (*ReadClusterToken) String added in v0.8.4

func (x *ReadClusterToken) String() string

type ReadClusters

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

func (*ReadClusters) Descriptor deprecated

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

Deprecated: Use ReadClusters.ProtoReflect.Descriptor instead.

func (*ReadClusters) ProtoMessage

func (*ReadClusters) ProtoMessage()

func (*ReadClusters) ProtoReflect

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

func (*ReadClusters) Reset

func (x *ReadClusters) Reset()

func (*ReadClusters) String

func (x *ReadClusters) 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 NewClusterServer

func NewClusterServer(svc Cluster, opts ...interface{}) TwirpServer

NewClusterServer 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).

type UpdateCluster

type UpdateCluster struct {
	Uuid string `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"` // unique id of the cluster
	Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` // name of the cluster
	// contains filtered or unexported fields
}

func (*UpdateCluster) Descriptor deprecated

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

Deprecated: Use UpdateCluster.ProtoReflect.Descriptor instead.

func (*UpdateCluster) GetName

func (x *UpdateCluster) GetName() string

func (*UpdateCluster) GetUuid

func (x *UpdateCluster) GetUuid() string

func (*UpdateCluster) ProtoMessage

func (*UpdateCluster) ProtoMessage()

func (*UpdateCluster) ProtoReflect

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

func (*UpdateCluster) Reset

func (x *UpdateCluster) Reset()

func (*UpdateCluster) String

func (x *UpdateCluster) String() string

Jump to

Keyboard shortcuts

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