Documentation ¶
Index ¶
- Constants
- Variables
- func WriteError(resp http.ResponseWriter, err error)
- type AgentService
- type AggregatedObservation
- func (*AggregatedObservation) Descriptor() ([]byte, []int)deprecated
- func (x *AggregatedObservation) GetDestHost() string
- func (x *AggregatedObservation) GetJobsNotOkCount() map[string]int32
- func (x *AggregatedObservation) GetJobsOkCount() map[string]int32
- func (x *AggregatedObservation) GetMeanOkDuration() map[string]*durationpb.Duration
- func (x *AggregatedObservation) GetPeriodEnd() *timestamppb.Timestamp
- func (x *AggregatedObservation) GetPeriodStart() *timestamppb.Timestamp
- func (x *AggregatedObservation) GetSrcHost() string
- func (*AggregatedObservation) ProtoMessage()
- func (x *AggregatedObservation) ProtoReflect() protoreflect.Message
- func (x *AggregatedObservation) Reset()
- func (x *AggregatedObservation) String() string
- type GetAggregatedObservationsResponse
- func (*GetAggregatedObservationsResponse) Descriptor() ([]byte, []int)deprecated
- func (x *GetAggregatedObservationsResponse) GetAggregatedObservations() []*AggregatedObservation
- func (*GetAggregatedObservationsResponse) ProtoMessage()
- func (x *GetAggregatedObservationsResponse) ProtoReflect() protoreflect.Message
- func (x *GetAggregatedObservationsResponse) Reset()
- func (x *GetAggregatedObservationsResponse) String() string
- type GetObservationsRequest
- func (*GetObservationsRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GetObservationsRequest) GetAggregationWindow() *durationpb.Duration
- func (x *GetObservationsRequest) GetEnd() *timestamppb.Timestamp
- func (x *GetObservationsRequest) GetFailuresOnly() bool
- func (x *GetObservationsRequest) GetLimit() int32
- func (x *GetObservationsRequest) GetRestrictToDestHosts() []string
- func (x *GetObservationsRequest) GetRestrictToJobIDs() []string
- func (x *GetObservationsRequest) GetRestrictToSrcHosts() []string
- func (x *GetObservationsRequest) GetStart() *timestamppb.Timestamp
- func (*GetObservationsRequest) ProtoMessage()
- func (x *GetObservationsRequest) ProtoReflect() protoreflect.Message
- func (x *GetObservationsRequest) Reset()
- func (x *GetObservationsRequest) String() string
- type GetObservationsResponse
- func (*GetObservationsResponse) Descriptor() ([]byte, []int)deprecated
- func (x *GetObservationsResponse) GetObservations() []*Observation
- func (*GetObservationsResponse) ProtoMessage()
- func (x *GetObservationsResponse) ProtoReflect() protoreflect.Message
- func (x *GetObservationsResponse) Reset()
- func (x *GetObservationsResponse) String() string
- type HTTPClient
- type Int64Arrays
- type IntObservation
- func (*IntObservation) Descriptor() ([]byte, []int)deprecated
- func (x *IntObservation) GetDestHost() int64
- func (x *IntObservation) GetDurationMillis() int32
- func (x *IntObservation) GetJobID() int64
- func (x *IntObservation) GetOk() bool
- func (x *IntObservation) GetPeriodMillis() int32
- func (x *IntObservation) GetSrcHost() int64
- func (x *IntObservation) GetTimeMillis() int64
- func (*IntObservation) ProtoMessage()
- func (x *IntObservation) ProtoReflect() protoreflect.Message
- func (x *IntObservation) Reset()
- func (x *IntObservation) String() string
- type IntString
- type ListObservationsOptions
- type Observation
- func (*Observation) Descriptor() ([]byte, []int)deprecated
- func (x *Observation) GetDestHost() string
- func (x *Observation) GetDuration() *durationpb.Duration
- func (x *Observation) GetJobID() string
- func (x *Observation) GetOk() bool
- func (x *Observation) GetPeriod() *durationpb.Duration
- func (x *Observation) GetResult() string
- func (x *Observation) GetSrcHost() string
- func (x *Observation) GetTimestamp() *timestamppb.Timestamp
- func (*Observation) ProtoMessage()
- func (x *Observation) ProtoReflect() protoreflect.Message
- func (x *Observation) Reset()
- func (x *Observation) String() string
- type ObservationListener
- type ObservationWriter
- type Observations
- type TwirpServer
Constants ¶
const AgentServicePathPrefix = "/twirp/nwpd.AgentService/"
AgentServicePathPrefix is a convenience constant that may identify URL paths. Should be used with caution, it only matches routes generated by Twirp Go clients, with the default "/twirp" prefix and default CamelCase service and method names. More info: https://twitchtv.github.io/twirp/docs/routing.html
Variables ¶
var File_pkg_common_nwpd_nwpd_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 AgentService ¶
type AgentService interface { GetObservations(context.Context, *GetObservationsRequest) (*GetObservationsResponse, error) GetAggregatedObservations(context.Context, *GetObservationsRequest) (*GetAggregatedObservationsResponse, error) }
Interface exported by the server.
func NewAgentServiceJSONClient ¶
func NewAgentServiceJSONClient(baseURL string, client HTTPClient, opts ...twirp.ClientOption) AgentService
NewAgentServiceJSONClient creates a JSON client that implements the AgentService interface. It communicates using JSON and can be configured with a custom HTTPClient.
func NewAgentServiceProtobufClient ¶
func NewAgentServiceProtobufClient(baseURL string, client HTTPClient, opts ...twirp.ClientOption) AgentService
NewAgentServiceProtobufClient creates a Protobuf client that implements the AgentService interface. It communicates using Protobuf and can be configured with a custom HTTPClient.
type AggregatedObservation ¶
type AggregatedObservation struct { SrcHost string `protobuf:"bytes,1,opt,name=srcHost,proto3" json:"srcHost,omitempty"` DestHost string `protobuf:"bytes,2,opt,name=destHost,proto3" json:"destHost,omitempty"` PeriodStart *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=periodStart,proto3" json:"periodStart,omitempty"` PeriodEnd *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=periodEnd,proto3" json:"periodEnd,omitempty"` JobsOkCount map[string]int32 `` /* 164-byte string literal not displayed */ JobsNotOkCount map[string]int32 `` /* 170-byte string literal not displayed */ MeanOkDuration map[string]*durationpb.Duration `` /* 169-byte string literal not displayed */ // contains filtered or unexported fields }
func (*AggregatedObservation) Descriptor
deprecated
func (*AggregatedObservation) Descriptor() ([]byte, []int)
Deprecated: Use AggregatedObservation.ProtoReflect.Descriptor instead.
func (*AggregatedObservation) GetDestHost ¶
func (x *AggregatedObservation) GetDestHost() string
func (*AggregatedObservation) GetJobsNotOkCount ¶
func (x *AggregatedObservation) GetJobsNotOkCount() map[string]int32
func (*AggregatedObservation) GetJobsOkCount ¶
func (x *AggregatedObservation) GetJobsOkCount() map[string]int32
func (*AggregatedObservation) GetMeanOkDuration ¶
func (x *AggregatedObservation) GetMeanOkDuration() map[string]*durationpb.Duration
func (*AggregatedObservation) GetPeriodEnd ¶
func (x *AggregatedObservation) GetPeriodEnd() *timestamppb.Timestamp
func (*AggregatedObservation) GetPeriodStart ¶
func (x *AggregatedObservation) GetPeriodStart() *timestamppb.Timestamp
func (*AggregatedObservation) GetSrcHost ¶
func (x *AggregatedObservation) GetSrcHost() string
func (*AggregatedObservation) ProtoMessage ¶
func (*AggregatedObservation) ProtoMessage()
func (*AggregatedObservation) ProtoReflect ¶
func (x *AggregatedObservation) ProtoReflect() protoreflect.Message
func (*AggregatedObservation) Reset ¶
func (x *AggregatedObservation) Reset()
func (*AggregatedObservation) String ¶
func (x *AggregatedObservation) String() string
type GetAggregatedObservationsResponse ¶
type GetAggregatedObservationsResponse struct { AggregatedObservations []*AggregatedObservation `protobuf:"bytes,1,rep,name=aggregatedObservations,proto3" json:"aggregatedObservations,omitempty"` // contains filtered or unexported fields }
func (*GetAggregatedObservationsResponse) Descriptor
deprecated
func (*GetAggregatedObservationsResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetAggregatedObservationsResponse.ProtoReflect.Descriptor instead.
func (*GetAggregatedObservationsResponse) GetAggregatedObservations ¶
func (x *GetAggregatedObservationsResponse) GetAggregatedObservations() []*AggregatedObservation
func (*GetAggregatedObservationsResponse) ProtoMessage ¶
func (*GetAggregatedObservationsResponse) ProtoMessage()
func (*GetAggregatedObservationsResponse) ProtoReflect ¶
func (x *GetAggregatedObservationsResponse) ProtoReflect() protoreflect.Message
func (*GetAggregatedObservationsResponse) Reset ¶
func (x *GetAggregatedObservationsResponse) Reset()
func (*GetAggregatedObservationsResponse) String ¶
func (x *GetAggregatedObservationsResponse) String() string
type GetObservationsRequest ¶
type GetObservationsRequest struct { Start *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=start,proto3" json:"start,omitempty"` End *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=end,proto3" json:"end,omitempty"` Limit int32 `protobuf:"varint,3,opt,name=limit,proto3" json:"limit,omitempty"` RestrictToJobIDs []string `protobuf:"bytes,4,rep,name=restrictToJobIDs,proto3" json:"restrictToJobIDs,omitempty"` RestrictToSrcHosts []string `protobuf:"bytes,5,rep,name=restrictToSrcHosts,proto3" json:"restrictToSrcHosts,omitempty"` RestrictToDestHosts []string `protobuf:"bytes,6,rep,name=restrictToDestHosts,proto3" json:"restrictToDestHosts,omitempty"` AggregationWindow *durationpb.Duration `protobuf:"bytes,7,opt,name=aggregationWindow,proto3" json:"aggregationWindow,omitempty"` FailuresOnly bool `protobuf:"varint,8,opt,name=failuresOnly,proto3" json:"failuresOnly,omitempty"` // contains filtered or unexported fields }
func (*GetObservationsRequest) Descriptor
deprecated
func (*GetObservationsRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetObservationsRequest.ProtoReflect.Descriptor instead.
func (*GetObservationsRequest) GetAggregationWindow ¶
func (x *GetObservationsRequest) GetAggregationWindow() *durationpb.Duration
func (*GetObservationsRequest) GetEnd ¶
func (x *GetObservationsRequest) GetEnd() *timestamppb.Timestamp
func (*GetObservationsRequest) GetFailuresOnly ¶
func (x *GetObservationsRequest) GetFailuresOnly() bool
func (*GetObservationsRequest) GetLimit ¶
func (x *GetObservationsRequest) GetLimit() int32
func (*GetObservationsRequest) GetRestrictToDestHosts ¶
func (x *GetObservationsRequest) GetRestrictToDestHosts() []string
func (*GetObservationsRequest) GetRestrictToJobIDs ¶
func (x *GetObservationsRequest) GetRestrictToJobIDs() []string
func (*GetObservationsRequest) GetRestrictToSrcHosts ¶
func (x *GetObservationsRequest) GetRestrictToSrcHosts() []string
func (*GetObservationsRequest) GetStart ¶
func (x *GetObservationsRequest) GetStart() *timestamppb.Timestamp
func (*GetObservationsRequest) ProtoMessage ¶
func (*GetObservationsRequest) ProtoMessage()
func (*GetObservationsRequest) ProtoReflect ¶
func (x *GetObservationsRequest) ProtoReflect() protoreflect.Message
func (*GetObservationsRequest) Reset ¶
func (x *GetObservationsRequest) Reset()
func (*GetObservationsRequest) String ¶
func (x *GetObservationsRequest) String() string
type GetObservationsResponse ¶
type GetObservationsResponse struct { Observations []*Observation `protobuf:"bytes,1,rep,name=observations,proto3" json:"observations,omitempty"` // contains filtered or unexported fields }
func (*GetObservationsResponse) Descriptor
deprecated
func (*GetObservationsResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetObservationsResponse.ProtoReflect.Descriptor instead.
func (*GetObservationsResponse) GetObservations ¶
func (x *GetObservationsResponse) GetObservations() []*Observation
func (*GetObservationsResponse) ProtoMessage ¶
func (*GetObservationsResponse) ProtoMessage()
func (*GetObservationsResponse) ProtoReflect ¶
func (x *GetObservationsResponse) ProtoReflect() protoreflect.Message
func (*GetObservationsResponse) Reset ¶
func (x *GetObservationsResponse) Reset()
func (*GetObservationsResponse) String ¶
func (x *GetObservationsResponse) String() string
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 Int64Arrays ¶
type Int64Arrays struct { Array []int64 `protobuf:"varint,1,rep,packed,name=array,proto3" json:"array,omitempty"` // contains filtered or unexported fields }
func (*Int64Arrays) Descriptor
deprecated
func (*Int64Arrays) Descriptor() ([]byte, []int)
Deprecated: Use Int64Arrays.ProtoReflect.Descriptor instead.
func (*Int64Arrays) GetArray ¶
func (x *Int64Arrays) GetArray() []int64
func (*Int64Arrays) ProtoMessage ¶
func (*Int64Arrays) ProtoMessage()
func (*Int64Arrays) ProtoReflect ¶
func (x *Int64Arrays) ProtoReflect() protoreflect.Message
func (*Int64Arrays) Reset ¶
func (x *Int64Arrays) Reset()
func (*Int64Arrays) String ¶
func (x *Int64Arrays) String() string
type IntObservation ¶
type IntObservation struct { JobID int64 `protobuf:"varint,1,opt,name=JobID,proto3" json:"JobID,omitempty"` SrcHost int64 `protobuf:"varint,2,opt,name=srcHost,proto3" json:"srcHost,omitempty"` DestHost int64 `protobuf:"varint,3,opt,name=destHost,proto3" json:"destHost,omitempty"` TimeMillis int64 `protobuf:"varint,4,opt,name=timeMillis,proto3" json:"timeMillis,omitempty"` DurationMillis int32 `protobuf:"varint,5,opt,name=durationMillis,proto3" json:"durationMillis,omitempty"` Ok bool `protobuf:"varint,6,opt,name=ok,proto3" json:"ok,omitempty"` PeriodMillis int32 `protobuf:"varint,7,opt,name=periodMillis,proto3" json:"periodMillis,omitempty"` // contains filtered or unexported fields }
func (*IntObservation) Descriptor
deprecated
func (*IntObservation) Descriptor() ([]byte, []int)
Deprecated: Use IntObservation.ProtoReflect.Descriptor instead.
func (*IntObservation) GetDestHost ¶
func (x *IntObservation) GetDestHost() int64
func (*IntObservation) GetDurationMillis ¶
func (x *IntObservation) GetDurationMillis() int32
func (*IntObservation) GetJobID ¶
func (x *IntObservation) GetJobID() int64
func (*IntObservation) GetOk ¶
func (x *IntObservation) GetOk() bool
func (*IntObservation) GetPeriodMillis ¶
func (x *IntObservation) GetPeriodMillis() int32
func (*IntObservation) GetSrcHost ¶
func (x *IntObservation) GetSrcHost() int64
func (*IntObservation) GetTimeMillis ¶
func (x *IntObservation) GetTimeMillis() int64
func (*IntObservation) ProtoMessage ¶
func (*IntObservation) ProtoMessage()
func (*IntObservation) ProtoReflect ¶
func (x *IntObservation) ProtoReflect() protoreflect.Message
func (*IntObservation) Reset ¶
func (x *IntObservation) Reset()
func (*IntObservation) String ¶
func (x *IntObservation) String() string
type IntString ¶
type IntString struct { Key int64 `protobuf:"varint,1,opt,name=key,proto3" json:"key,omitempty"` Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` // contains filtered or unexported fields }
func (*IntString) Descriptor
deprecated
func (*IntString) ProtoMessage ¶
func (*IntString) ProtoMessage()
func (*IntString) ProtoReflect ¶
func (x *IntString) ProtoReflect() protoreflect.Message
type ListObservationsOptions ¶
type Observation ¶
type Observation struct { JobID string `protobuf:"bytes,1,opt,name=jobID,proto3" json:"jobID,omitempty"` SrcHost string `protobuf:"bytes,2,opt,name=srcHost,proto3" json:"srcHost,omitempty"` DestHost string `protobuf:"bytes,3,opt,name=destHost,proto3" json:"destHost,omitempty"` Timestamp *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=timestamp,proto3" json:"timestamp,omitempty"` Duration *durationpb.Duration `protobuf:"bytes,5,opt,name=duration,proto3" json:"duration,omitempty"` Result string `protobuf:"bytes,6,opt,name=result,proto3" json:"result,omitempty"` // not persisted Ok bool `protobuf:"varint,7,opt,name=ok,proto3" json:"ok,omitempty"` Period *durationpb.Duration `protobuf:"bytes,8,opt,name=period,proto3" json:"period,omitempty"` // contains filtered or unexported fields }
func (*Observation) Descriptor
deprecated
func (*Observation) Descriptor() ([]byte, []int)
Deprecated: Use Observation.ProtoReflect.Descriptor instead.
func (*Observation) GetDestHost ¶
func (x *Observation) GetDestHost() string
func (*Observation) GetDuration ¶
func (x *Observation) GetDuration() *durationpb.Duration
func (*Observation) GetJobID ¶
func (x *Observation) GetJobID() string
func (*Observation) GetOk ¶
func (x *Observation) GetOk() bool
func (*Observation) GetPeriod ¶
func (x *Observation) GetPeriod() *durationpb.Duration
func (*Observation) GetResult ¶
func (x *Observation) GetResult() string
func (*Observation) GetSrcHost ¶
func (x *Observation) GetSrcHost() string
func (*Observation) GetTimestamp ¶
func (x *Observation) GetTimestamp() *timestamppb.Timestamp
func (*Observation) ProtoMessage ¶
func (*Observation) ProtoMessage()
func (*Observation) ProtoReflect ¶
func (x *Observation) ProtoReflect() protoreflect.Message
func (*Observation) Reset ¶
func (x *Observation) Reset()
func (*Observation) String ¶
func (x *Observation) String() string
type ObservationListener ¶
type ObservationListener interface {
Add(obs *Observation)
}
type ObservationWriter ¶
type ObservationWriter interface { ObservationListener Run() Stop() ListObservations(options ListObservationsOptions) (Observations, error) }
type Observations ¶
type Observations []*Observation
func (Observations) Len ¶
func (o Observations) Len() int
func (Observations) Less ¶
func (o Observations) Less(i, j int) bool
func (Observations) Swap ¶
func (o Observations) Swap(i, j int)
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 // google.golang.org/protobuf/types/descriptorpb.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 NewAgentServiceServer ¶
func NewAgentServiceServer(svc AgentService, opts ...interface{}) TwirpServer
NewAgentServiceServer 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).