application

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

application.proto

Index

Constants

View Source
const ApplicationPathPrefix = "/twirp/redsail.bosn.Application/"

ApplicationPathPrefix 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_application_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 Application

type Application interface {
	// gets all applications currently found in each cluster and their status
	All(context.Context, *ReadApplications) (*ApplicationsRead, error)
}

func NewApplicationJSONClient

func NewApplicationJSONClient(baseURL string, client HTTPClient, opts ...twirp.ClientOption) Application

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

func NewApplicationProtobufClient

func NewApplicationProtobufClient(baseURL string, client HTTPClient, opts ...twirp.ClientOption) Application

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

type ApplicationCluster

type ApplicationCluster struct {
	ClusterName string `protobuf:"bytes,1,opt,name=cluster_name,json=clusterName,proto3" json:"cluster_name,omitempty"` // the cluster name
	Version     string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"`                            // the app version by label app.kubernetes.io/version
	Namespace   string `protobuf:"bytes,3,opt,name=namespace,proto3" json:"namespace,omitempty"`                        // the namespace
	Ready       bool   `protobuf:"varint,4,opt,name=ready,proto3" json:"ready,omitempty"`                               // whether all deployment or ss pods are ready
	// contains filtered or unexported fields
}

func (*ApplicationCluster) Descriptor deprecated

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

Deprecated: Use ApplicationCluster.ProtoReflect.Descriptor instead.

func (*ApplicationCluster) GetClusterName

func (x *ApplicationCluster) GetClusterName() string

func (*ApplicationCluster) GetNamespace

func (x *ApplicationCluster) GetNamespace() string

func (*ApplicationCluster) GetReady

func (x *ApplicationCluster) GetReady() bool

func (*ApplicationCluster) GetVersion

func (x *ApplicationCluster) GetVersion() string

func (*ApplicationCluster) ProtoMessage

func (*ApplicationCluster) ProtoMessage()

func (*ApplicationCluster) ProtoReflect

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

func (*ApplicationCluster) Reset

func (x *ApplicationCluster) Reset()

func (*ApplicationCluster) String

func (x *ApplicationCluster) String() string

type ApplicationRead

type ApplicationRead struct {
	Name     string                `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`         // the application name by label app.kubernetes.io/name
	Project  string                `protobuf:"bytes,2,opt,name=project,proto3" json:"project,omitempty"`   // the project by label app.kubernetes.io/part-of
	Clusters []*ApplicationCluster `protobuf:"bytes,3,rep,name=clusters,proto3" json:"clusters,omitempty"` // the list of isntances of this application by cluster
	// contains filtered or unexported fields
}

func (*ApplicationRead) Descriptor deprecated

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

Deprecated: Use ApplicationRead.ProtoReflect.Descriptor instead.

func (*ApplicationRead) GetClusters

func (x *ApplicationRead) GetClusters() []*ApplicationCluster

func (*ApplicationRead) GetName

func (x *ApplicationRead) GetName() string

func (*ApplicationRead) GetProject

func (x *ApplicationRead) GetProject() string

func (*ApplicationRead) ProtoMessage

func (*ApplicationRead) ProtoMessage()

func (*ApplicationRead) ProtoReflect

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

func (*ApplicationRead) Reset

func (x *ApplicationRead) Reset()

func (*ApplicationRead) String

func (x *ApplicationRead) String() string

type ApplicationsRead

type ApplicationsRead struct {
	Applications []*ApplicationRead `protobuf:"bytes,1,rep,name=applications,proto3" json:"applications,omitempty"` // the list of applications
	// contains filtered or unexported fields
}

func (*ApplicationsRead) Descriptor deprecated

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

Deprecated: Use ApplicationsRead.ProtoReflect.Descriptor instead.

func (*ApplicationsRead) GetApplications

func (x *ApplicationsRead) GetApplications() []*ApplicationRead

func (*ApplicationsRead) ProtoMessage

func (*ApplicationsRead) ProtoMessage()

func (*ApplicationsRead) ProtoReflect

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

func (*ApplicationsRead) Reset

func (x *ApplicationsRead) Reset()

func (*ApplicationsRead) String

func (x *ApplicationsRead) 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 ReadApplications

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

func (*ReadApplications) Descriptor deprecated

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

Deprecated: Use ReadApplications.ProtoReflect.Descriptor instead.

func (*ReadApplications) ProtoMessage

func (*ReadApplications) ProtoMessage()

func (*ReadApplications) ProtoReflect

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

func (*ReadApplications) Reset

func (x *ReadApplications) Reset()

func (*ReadApplications) String

func (x *ReadApplications) 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 NewApplicationServer

func NewApplicationServer(svc Application, opts ...interface{}) TwirpServer

NewApplicationServer 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