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
- func WriteError(resp http.ResponseWriter, err error)
- type CheckIDs
- type HTTPClient
- type Health
- func (*Health) Descriptor() ([]byte, []int)
- func (m *Health) GetBody() string
- func (m *Health) GetError() string
- func (m *Health) GetHealthy() bool
- func (m *Health) GetResponseTimeNanoseconds() int64
- func (m *Health) GetStatusCode() int32
- func (m *Health) GetUrl() string
- func (*Health) ProtoMessage()
- func (m *Health) Reset()
- func (m *Health) String() string
- type HistogramData
- func (*HistogramData) Descriptor() ([]byte, []int)
- func (m *HistogramData) GetMaxNanoseconds() int64
- func (m *HistogramData) GetMeanNanoseconds() int64
- func (m *HistogramData) GetMinNanoseconds() int64
- func (m *HistogramData) GetP50Nanoseconds() int64
- func (m *HistogramData) GetP75Nanoseconds() int64
- func (m *HistogramData) GetP95Nanoseconds() int64
- func (m *HistogramData) GetP99Nanoseconds() int64
- func (m *HistogramData) GetStddev() int64
- func (*HistogramData) ProtoMessage()
- func (m *HistogramData) Reset()
- func (m *HistogramData) String() string
- type Nil
- type Run
- func (*Run) Descriptor() ([]byte, []int)
- func (m *Run) GetCids() *CheckIDs
- func (m *Run) GetElapsedNanoseconds() int64
- func (m *Run) GetFinished() bool
- func (m *Run) GetId() string
- func (m *Run) GetResults() map[string]*Health
- func (m *Run) GetStartTimeUnix() int64
- func (*Run) ProtoMessage()
- func (m *Run) Reset()
- func (m *Run) String() string
- type RunLocal
- type TwirpServer
- type WebhookData
Constants ¶
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) ProtoMessage ¶
func (*CheckIDs) ProtoMessage()
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 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) GetHealthy ¶
func (*Health) GetResponseTimeNanoseconds ¶
func (*Health) GetStatusCode ¶
func (*Health) ProtoMessage ¶
func (*Health) ProtoMessage()
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) ProtoMessage ¶
func (*Nil) ProtoMessage()
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) GetElapsedNanoseconds ¶
func (*Run) GetFinished ¶
func (*Run) GetResults ¶
func (*Run) GetStartTimeUnix ¶
func (*Run) ProtoMessage ¶
func (*Run) ProtoMessage()
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