lokahiadmin

package
v0.0.0-...-4305b7b Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2018 License: MIT Imports: 16 Imported by: 3

Documentation

Overview

Package lokahiadmin is a generated protocol buffer package.

lokahiadmin is the administrative/backend API for lokahi power usage.

It is generated from these files:

lokahiadmin.proto

It has these top-level messages:

CheckIDs
Health
Run
Nil
HistogramData
WebhookData

Package lokahiadmin is a generated twirp stub package. This code was generated with github.com/twitchtv/twirp/protoc-gen-twirp v5.2.0.

lokahiadmin is the administrative/backend API for lokahi power usage.

It is generated from these files:

lokahiadmin.proto

Index

Constants

View Source
const RunLocalPathPrefix = "/twirp/github.xe.lokahi.admin.RunLocal/"

RunLocalPathPrefix is used for all URL paths on a twirp RunLocal server. Requests are always: POST RunLocalPathPrefix/method It can be used in an HTTP mux to route twirp requests along with non-twirp requests on other routes.

Variables

This section is empty.

Functions

func WriteError

func WriteError(resp http.ResponseWriter, err error)

WriteError writes an HTTP response with a valid Twirp error format. If err is not a twirp.Error, it will get wrapped with twirp.InternalErrorWith(err)

Types

type CheckIDs

type CheckIDs struct {
	Ids []string `protobuf:"bytes,1,rep,name=ids" json:"ids,omitempty"`
}

func (*CheckIDs) Descriptor

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

func (*CheckIDs) GetIds

func (m *CheckIDs) GetIds() []string

func (*CheckIDs) ProtoMessage

func (*CheckIDs) ProtoMessage()

func (*CheckIDs) Reset

func (m *CheckIDs) Reset()

func (*CheckIDs) String

func (m *CheckIDs) 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 Health

type Health struct {
	Url                     string `protobuf:"bytes,1,opt,name=url" json:"url,omitempty"`
	ResponseTimeNanoseconds int64  `` /* 126-byte string literal not displayed */
	StatusCode              int32  `protobuf:"varint,3,opt,name=status_code,json=statusCode" json:"status_code,omitempty"`
	Body                    string `protobuf:"bytes,4,opt,name=body" json:"body,omitempty"`
	Error                   string `protobuf:"bytes,5,opt,name=error" json:"error,omitempty"`
	Healthy                 bool   `protobuf:"varint,6,opt,name=healthy" json:"healthy,omitempty"`
}

func (*Health) Descriptor

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

func (*Health) GetBody

func (m *Health) GetBody() string

func (*Health) GetError

func (m *Health) GetError() string

func (*Health) GetHealthy

func (m *Health) GetHealthy() bool

func (*Health) GetResponseTimeNanoseconds

func (m *Health) GetResponseTimeNanoseconds() int64

func (*Health) GetStatusCode

func (m *Health) GetStatusCode() int32

func (*Health) GetUrl

func (m *Health) GetUrl() string

func (*Health) ProtoMessage

func (*Health) ProtoMessage()

func (*Health) Reset

func (m *Health) Reset()

func (*Health) String

func (m *Health) String() string

type HistogramData

type HistogramData struct {
	// max_nanoseconds is the maximum http web response time in nanoseconds.
	MaxNanoseconds int64 `protobuf:"varint,1,opt,name=max_nanoseconds,json=maxNanoseconds" json:"max_nanoseconds,omitempty"`
	// min_nanoseconds is the minimum http web response time in nanoseconds.
	MinNanoseconds int64 `protobuf:"varint,2,opt,name=min_nanoseconds,json=minNanoseconds" json:"min_nanoseconds,omitempty"`
	// mean_nanoseconds is the mean http web response time in nanoseconds.
	MeanNanoseconds int64 `protobuf:"varint,3,opt,name=mean_nanoseconds,json=meanNanoseconds" json:"mean_nanoseconds,omitempty"`
	// stddev is the standard deviation from the mean.
	Stddev int64 `protobuf:"varint,4,opt,name=stddev" json:"stddev,omitempty"`
	// p50_nanoseconds is the 50th percentile of the http web response times in
	// nanoseconds.
	P50Nanoseconds int64 `protobuf:"varint,5,opt,name=p50_nanoseconds,json=p50Nanoseconds" json:"p50_nanoseconds,omitempty"`
	// p75_nanoseconds is the 75th percentile of the http web response times in
	// nanoseconds.
	P75Nanoseconds int64 `protobuf:"varint,6,opt,name=p75_nanoseconds,json=p75Nanoseconds" json:"p75_nanoseconds,omitempty"`
	// p95_nanoseconds is the 95th percentile of the http web response times in
	// nanoseconds.
	P95Nanoseconds int64 `protobuf:"varint,7,opt,name=p95_nanoseconds,json=p95Nanoseconds" json:"p95_nanoseconds,omitempty"`
	// p99_nanoseconds is the 95th percentile of the http web response times in
	// nanoseconds.
	P99Nanoseconds int64 `protobuf:"varint,8,opt,name=p99_nanoseconds,json=p99Nanoseconds" json:"p99_nanoseconds,omitempty"`
}

HistogramData contains information from the HDR histogram maintained for each check.

func (*HistogramData) Descriptor

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

func (*HistogramData) GetMaxNanoseconds

func (m *HistogramData) GetMaxNanoseconds() int64

func (*HistogramData) GetMeanNanoseconds

func (m *HistogramData) GetMeanNanoseconds() int64

func (*HistogramData) GetMinNanoseconds

func (m *HistogramData) GetMinNanoseconds() int64

func (*HistogramData) GetP50Nanoseconds

func (m *HistogramData) GetP50Nanoseconds() int64

func (*HistogramData) GetP75Nanoseconds

func (m *HistogramData) GetP75Nanoseconds() int64

func (*HistogramData) GetP95Nanoseconds

func (m *HistogramData) GetP95Nanoseconds() int64

func (*HistogramData) GetP99Nanoseconds

func (m *HistogramData) GetP99Nanoseconds() int64

func (*HistogramData) GetStddev

func (m *HistogramData) GetStddev() int64

func (*HistogramData) ProtoMessage

func (*HistogramData) ProtoMessage()

func (*HistogramData) Reset

func (m *HistogramData) Reset()

func (*HistogramData) String

func (m *HistogramData) String() string

type Nil

type Nil struct {
}

func (*Nil) Descriptor

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

func (*Nil) ProtoMessage

func (*Nil) ProtoMessage()

func (*Nil) Reset

func (m *Nil) Reset()

func (*Nil) String

func (m *Nil) String() string

type Run

type Run struct {
	Id                 string             `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"`
	Cids               *CheckIDs          `protobuf:"bytes,2,opt,name=cids" json:"cids,omitempty"`
	Finished           bool               `protobuf:"varint,3,opt,name=finished" json:"finished,omitempty"`
	Results            map[string]*Health `` /* 134-byte string literal not displayed */
	StartTimeUnix      int64              `protobuf:"varint,5,opt,name=start_time_unix,json=startTimeUnix" json:"start_time_unix,omitempty"`
	ElapsedNanoseconds int64              `protobuf:"varint,6,opt,name=elapsed_nanoseconds,json=elapsedNanoseconds" json:"elapsed_nanoseconds,omitempty"`
}

func (*Run) Descriptor

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

func (*Run) GetCids

func (m *Run) GetCids() *CheckIDs

func (*Run) GetElapsedNanoseconds

func (m *Run) GetElapsedNanoseconds() int64

func (*Run) GetFinished

func (m *Run) GetFinished() bool

func (*Run) GetId

func (m *Run) GetId() string

func (*Run) GetResults

func (m *Run) GetResults() map[string]*Health

func (*Run) GetStartTimeUnix

func (m *Run) GetStartTimeUnix() int64

func (*Run) ProtoMessage

func (*Run) ProtoMessage()

func (*Run) Reset

func (m *Run) Reset()

func (*Run) String

func (m *Run) String() string

type RunLocal

type RunLocal interface {
	Checks(context.Context, *CheckIDs) (*Run, error)

	Stats(context.Context, *Nil) (*HistogramData, error)
}

func NewRunLocalJSONClient

func NewRunLocalJSONClient(addr string, client HTTPClient) RunLocal

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

func NewRunLocalProtobufClient

func NewRunLocalProtobufClient(addr string, client HTTPClient) RunLocal

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

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
}

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 NewRunLocalServer

func NewRunLocalServer(svc RunLocal, hooks *twirp.ServerHooks) TwirpServer

type WebhookData

type WebhookData struct {
	RunId      string  `protobuf:"bytes,1,opt,name=run_id,json=runId" json:"run_id,omitempty"`
	CheckProto []byte  `protobuf:"bytes,2,opt,name=check_proto,json=checkProto,proto3" json:"check_proto,omitempty"`
	Health     *Health `protobuf:"bytes,3,opt,name=health" json:"health,omitempty"`
}

func (*WebhookData) Descriptor

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

func (*WebhookData) GetCheckProto

func (m *WebhookData) GetCheckProto() []byte

func (*WebhookData) GetHealth

func (m *WebhookData) GetHealth() *Health

func (*WebhookData) GetRunId

func (m *WebhookData) GetRunId() string

func (*WebhookData) ProtoMessage

func (*WebhookData) ProtoMessage()

func (*WebhookData) Reset

func (m *WebhookData) Reset()

func (*WebhookData) String

func (m *WebhookData) String() string

Jump to

Keyboard shortcuts

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