Documentation ¶
Index ¶
- Constants
- Variables
- func WriteError(resp http.ResponseWriter, err error)
- type API
- type GetSchemaRequest
- type GetSchemaResponse
- func (*GetSchemaResponse) Descriptor() ([]byte, []int)deprecated
- func (x *GetSchemaResponse) GetSchema() *proto.Schema
- func (*GetSchemaResponse) ProtoMessage()
- func (x *GetSchemaResponse) ProtoReflect() protoreflect.Message
- func (x *GetSchemaResponse) Reset()
- func (x *GetSchemaResponse) String() string
- type GetTraceRequest
- type GetTraceResponse
- type HTTPClient
- type ListTraceFilter
- func (*ListTraceFilter) Descriptor() ([]byte, []int)deprecated
- func (x *ListTraceFilter) GetField() string
- func (x *ListTraceFilter) GetValue() string
- func (*ListTraceFilter) ProtoMessage()
- func (x *ListTraceFilter) ProtoReflect() protoreflect.Message
- func (x *ListTraceFilter) Reset()
- func (x *ListTraceFilter) String() string
- type ListTracesRequest
- func (*ListTracesRequest) Descriptor() ([]byte, []int)deprecated
- func (x *ListTracesRequest) GetAfter() *timestamppb.Timestamp
- func (x *ListTracesRequest) GetBefore() *timestamppb.Timestamp
- func (x *ListTracesRequest) GetEnvironmentId() string
- func (x *ListTracesRequest) GetFilters() []*ListTraceFilter
- func (x *ListTracesRequest) GetLimit() int32
- func (x *ListTracesRequest) GetOffset() int32
- func (*ListTracesRequest) ProtoMessage()
- func (x *ListTracesRequest) ProtoReflect() protoreflect.Message
- func (x *ListTracesRequest) Reset()
- func (x *ListTracesRequest) String() string
- type ListTracesResponse
- func (*ListTracesResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ListTracesResponse) GetTraces() []*TraceItem
- func (*ListTracesResponse) ProtoMessage()
- func (x *ListTracesResponse) ProtoReflect() protoreflect.Message
- func (x *ListTracesResponse) Reset()
- func (x *ListTracesResponse) String() string
- type SQLQueryInput
- func (*SQLQueryInput) Descriptor() ([]byte, []int)deprecated
- func (x *SQLQueryInput) GetEnvironmentID() string
- func (x *SQLQueryInput) GetProjectID() string
- func (x *SQLQueryInput) GetQuery() string
- func (*SQLQueryInput) ProtoMessage()
- func (x *SQLQueryInput) ProtoReflect() protoreflect.Message
- func (x *SQLQueryInput) Reset()
- func (x *SQLQueryInput) String() string
- type SQLQueryResponse
- func (*SQLQueryResponse) Descriptor() ([]byte, []int)deprecated
- func (x *SQLQueryResponse) GetError() string
- func (x *SQLQueryResponse) GetExecutionDuration() int32
- func (x *SQLQueryResponse) GetResultsJSON() string
- func (x *SQLQueryResponse) GetStatus() SQLQueryStatus
- func (x *SQLQueryResponse) GetTotalRows() int32
- func (*SQLQueryResponse) ProtoMessage()
- func (x *SQLQueryResponse) ProtoReflect() protoreflect.Message
- func (x *SQLQueryResponse) Reset()
- func (x *SQLQueryResponse) String() string
- type SQLQueryStatus
- func (SQLQueryStatus) Descriptor() protoreflect.EnumDescriptor
- func (x SQLQueryStatus) Enum() *SQLQueryStatus
- func (SQLQueryStatus) EnumDescriptor() ([]byte, []int)deprecated
- func (x SQLQueryStatus) Number() protoreflect.EnumNumber
- func (x SQLQueryStatus) String() string
- func (SQLQueryStatus) Type() protoreflect.EnumType
- type TraceItem
- func (*TraceItem) Descriptor() ([]byte, []int)deprecated
- func (x *TraceItem) GetDeploymentId() string
- func (x *TraceItem) GetDurationMs() float32
- func (x *TraceItem) GetEndTime() *timestamppb.Timestamp
- func (x *TraceItem) GetEnvironmentId() string
- func (x *TraceItem) GetError() bool
- func (x *TraceItem) GetProjectId() string
- func (x *TraceItem) GetRootName() string
- func (x *TraceItem) GetRuntimeVersion() string
- func (x *TraceItem) GetStartTime() *timestamppb.Timestamp
- func (x *TraceItem) GetTraceId() string
- func (*TraceItem) ProtoMessage()
- func (x *TraceItem) ProtoReflect() protoreflect.Message
- func (x *TraceItem) Reset()
- func (x *TraceItem) String() string
- type TwirpServer
Constants ¶
const APIPathPrefix = "/twirp/rpc.API/"
APIPathPrefix 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 ( SQLQueryStatus_name = map[int32]string{ 0: "success", 1: "failed", } SQLQueryStatus_value = map[string]int32{ "success": 0, "failed": 1, } )
Enum value maps for SQLQueryStatus.
var File_rpc_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 API ¶
type API interface { GetActiveSchema(context.Context, *GetSchemaRequest) (*GetSchemaResponse, error) RunSQLQuery(context.Context, *SQLQueryInput) (*SQLQueryResponse, error) GetTrace(context.Context, *GetTraceRequest) (*GetTraceResponse, error) ListTraces(context.Context, *ListTracesRequest) (*ListTracesResponse, error) }
func NewAPIJSONClient ¶
func NewAPIJSONClient(baseURL string, client HTTPClient, opts ...twirp.ClientOption) API
NewAPIJSONClient creates a JSON client that implements the API interface. It communicates using JSON and can be configured with a custom HTTPClient.
func NewAPIProtobufClient ¶
func NewAPIProtobufClient(baseURL string, client HTTPClient, opts ...twirp.ClientOption) API
NewAPIProtobufClient creates a Protobuf client that implements the API interface. It communicates using Protobuf and can be configured with a custom HTTPClient.
type GetSchemaRequest ¶
type GetSchemaRequest struct { EnvironmentId string `protobuf:"bytes,1,opt,name=environment_id,json=environmentId,proto3" json:"environment_id,omitempty"` // contains filtered or unexported fields }
func (*GetSchemaRequest) Descriptor
deprecated
func (*GetSchemaRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetSchemaRequest.ProtoReflect.Descriptor instead.
func (*GetSchemaRequest) GetEnvironmentId ¶
func (x *GetSchemaRequest) GetEnvironmentId() string
func (*GetSchemaRequest) ProtoMessage ¶
func (*GetSchemaRequest) ProtoMessage()
func (*GetSchemaRequest) ProtoReflect ¶
func (x *GetSchemaRequest) ProtoReflect() protoreflect.Message
func (*GetSchemaRequest) Reset ¶
func (x *GetSchemaRequest) Reset()
func (*GetSchemaRequest) String ¶
func (x *GetSchemaRequest) String() string
type GetSchemaResponse ¶
type GetSchemaResponse struct { Schema *proto.Schema `protobuf:"bytes,1,opt,name=schema,proto3" json:"schema,omitempty"` // contains filtered or unexported fields }
func (*GetSchemaResponse) Descriptor
deprecated
func (*GetSchemaResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetSchemaResponse.ProtoReflect.Descriptor instead.
func (*GetSchemaResponse) GetSchema ¶
func (x *GetSchemaResponse) GetSchema() *proto.Schema
func (*GetSchemaResponse) ProtoMessage ¶
func (*GetSchemaResponse) ProtoMessage()
func (*GetSchemaResponse) ProtoReflect ¶
func (x *GetSchemaResponse) ProtoReflect() protoreflect.Message
func (*GetSchemaResponse) Reset ¶
func (x *GetSchemaResponse) Reset()
func (*GetSchemaResponse) String ¶
func (x *GetSchemaResponse) String() string
type GetTraceRequest ¶
type GetTraceRequest struct { TraceId string `protobuf:"bytes,1,opt,name=trace_id,json=traceId,proto3" json:"trace_id,omitempty"` // contains filtered or unexported fields }
func (*GetTraceRequest) Descriptor
deprecated
func (*GetTraceRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetTraceRequest.ProtoReflect.Descriptor instead.
func (*GetTraceRequest) GetTraceId ¶
func (x *GetTraceRequest) GetTraceId() string
func (*GetTraceRequest) ProtoMessage ¶
func (*GetTraceRequest) ProtoMessage()
func (*GetTraceRequest) ProtoReflect ¶
func (x *GetTraceRequest) ProtoReflect() protoreflect.Message
func (*GetTraceRequest) Reset ¶
func (x *GetTraceRequest) Reset()
func (*GetTraceRequest) String ¶
func (x *GetTraceRequest) String() string
type GetTraceResponse ¶
type GetTraceResponse struct { Trace *v1.TracesData `protobuf:"bytes,1,opt,name=trace,proto3" json:"trace,omitempty"` // contains filtered or unexported fields }
func (*GetTraceResponse) Descriptor
deprecated
func (*GetTraceResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetTraceResponse.ProtoReflect.Descriptor instead.
func (*GetTraceResponse) GetTrace ¶
func (x *GetTraceResponse) GetTrace() *v1.TracesData
func (*GetTraceResponse) ProtoMessage ¶
func (*GetTraceResponse) ProtoMessage()
func (*GetTraceResponse) ProtoReflect ¶
func (x *GetTraceResponse) ProtoReflect() protoreflect.Message
func (*GetTraceResponse) Reset ¶
func (x *GetTraceResponse) Reset()
func (*GetTraceResponse) String ¶
func (x *GetTraceResponse) 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 ListTraceFilter ¶
type ListTraceFilter struct { Field string `protobuf:"bytes,1,opt,name=field,proto3" json:"field,omitempty"` Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` // contains filtered or unexported fields }
func (*ListTraceFilter) Descriptor
deprecated
func (*ListTraceFilter) Descriptor() ([]byte, []int)
Deprecated: Use ListTraceFilter.ProtoReflect.Descriptor instead.
func (*ListTraceFilter) GetField ¶
func (x *ListTraceFilter) GetField() string
func (*ListTraceFilter) GetValue ¶
func (x *ListTraceFilter) GetValue() string
func (*ListTraceFilter) ProtoMessage ¶
func (*ListTraceFilter) ProtoMessage()
func (*ListTraceFilter) ProtoReflect ¶
func (x *ListTraceFilter) ProtoReflect() protoreflect.Message
func (*ListTraceFilter) Reset ¶
func (x *ListTraceFilter) Reset()
func (*ListTraceFilter) String ¶
func (x *ListTraceFilter) String() string
type ListTracesRequest ¶
type ListTracesRequest struct { EnvironmentId string `protobuf:"bytes,1,opt,name=environment_id,json=environmentId,proto3" json:"environment_id,omitempty"` Before *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=before,proto3" json:"before,omitempty"` After *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=after,proto3" json:"after,omitempty"` Filters []*ListTraceFilter `protobuf:"bytes,4,rep,name=filters,proto3" json:"filters,omitempty"` Limit int32 `protobuf:"varint,5,opt,name=limit,proto3" json:"limit,omitempty"` Offset int32 `protobuf:"varint,6,opt,name=offset,proto3" json:"offset,omitempty"` // contains filtered or unexported fields }
func (*ListTracesRequest) Descriptor
deprecated
func (*ListTracesRequest) Descriptor() ([]byte, []int)
Deprecated: Use ListTracesRequest.ProtoReflect.Descriptor instead.
func (*ListTracesRequest) GetAfter ¶
func (x *ListTracesRequest) GetAfter() *timestamppb.Timestamp
func (*ListTracesRequest) GetBefore ¶
func (x *ListTracesRequest) GetBefore() *timestamppb.Timestamp
func (*ListTracesRequest) GetEnvironmentId ¶
func (x *ListTracesRequest) GetEnvironmentId() string
func (*ListTracesRequest) GetFilters ¶
func (x *ListTracesRequest) GetFilters() []*ListTraceFilter
func (*ListTracesRequest) GetLimit ¶
func (x *ListTracesRequest) GetLimit() int32
func (*ListTracesRequest) GetOffset ¶
func (x *ListTracesRequest) GetOffset() int32
func (*ListTracesRequest) ProtoMessage ¶
func (*ListTracesRequest) ProtoMessage()
func (*ListTracesRequest) ProtoReflect ¶
func (x *ListTracesRequest) ProtoReflect() protoreflect.Message
func (*ListTracesRequest) Reset ¶
func (x *ListTracesRequest) Reset()
func (*ListTracesRequest) String ¶
func (x *ListTracesRequest) String() string
type ListTracesResponse ¶
type ListTracesResponse struct { Traces []*TraceItem `protobuf:"bytes,1,rep,name=traces,proto3" json:"traces,omitempty"` // contains filtered or unexported fields }
func (*ListTracesResponse) Descriptor
deprecated
func (*ListTracesResponse) Descriptor() ([]byte, []int)
Deprecated: Use ListTracesResponse.ProtoReflect.Descriptor instead.
func (*ListTracesResponse) GetTraces ¶
func (x *ListTracesResponse) GetTraces() []*TraceItem
func (*ListTracesResponse) ProtoMessage ¶
func (*ListTracesResponse) ProtoMessage()
func (*ListTracesResponse) ProtoReflect ¶
func (x *ListTracesResponse) ProtoReflect() protoreflect.Message
func (*ListTracesResponse) Reset ¶
func (x *ListTracesResponse) Reset()
func (*ListTracesResponse) String ¶
func (x *ListTracesResponse) String() string
type SQLQueryInput ¶
type SQLQueryInput struct { ProjectID string `protobuf:"bytes,1,opt,name=projectID,proto3" json:"projectID,omitempty"` EnvironmentID string `protobuf:"bytes,2,opt,name=environmentID,proto3" json:"environmentID,omitempty"` Query string `protobuf:"bytes,3,opt,name=query,proto3" json:"query,omitempty"` // contains filtered or unexported fields }
func (*SQLQueryInput) Descriptor
deprecated
func (*SQLQueryInput) Descriptor() ([]byte, []int)
Deprecated: Use SQLQueryInput.ProtoReflect.Descriptor instead.
func (*SQLQueryInput) GetEnvironmentID ¶
func (x *SQLQueryInput) GetEnvironmentID() string
func (*SQLQueryInput) GetProjectID ¶
func (x *SQLQueryInput) GetProjectID() string
func (*SQLQueryInput) GetQuery ¶
func (x *SQLQueryInput) GetQuery() string
func (*SQLQueryInput) ProtoMessage ¶
func (*SQLQueryInput) ProtoMessage()
func (*SQLQueryInput) ProtoReflect ¶
func (x *SQLQueryInput) ProtoReflect() protoreflect.Message
func (*SQLQueryInput) Reset ¶
func (x *SQLQueryInput) Reset()
func (*SQLQueryInput) String ¶
func (x *SQLQueryInput) String() string
type SQLQueryResponse ¶
type SQLQueryResponse struct { Status SQLQueryStatus `protobuf:"varint,1,opt,name=status,proto3,enum=rpc.SQLQueryStatus" json:"status,omitempty"` ExecutionDuration int32 `protobuf:"varint,2,opt,name=executionDuration,proto3" json:"executionDuration,omitempty"` ResultsJSON string `protobuf:"bytes,3,opt,name=resultsJSON,proto3" json:"resultsJSON,omitempty"` TotalRows int32 `protobuf:"varint,4,opt,name=totalRows,proto3" json:"totalRows,omitempty"` Error string `protobuf:"bytes,5,opt,name=error,proto3" json:"error,omitempty"` // contains filtered or unexported fields }
func (*SQLQueryResponse) Descriptor
deprecated
func (*SQLQueryResponse) Descriptor() ([]byte, []int)
Deprecated: Use SQLQueryResponse.ProtoReflect.Descriptor instead.
func (*SQLQueryResponse) GetError ¶
func (x *SQLQueryResponse) GetError() string
func (*SQLQueryResponse) GetExecutionDuration ¶
func (x *SQLQueryResponse) GetExecutionDuration() int32
func (*SQLQueryResponse) GetResultsJSON ¶
func (x *SQLQueryResponse) GetResultsJSON() string
func (*SQLQueryResponse) GetStatus ¶
func (x *SQLQueryResponse) GetStatus() SQLQueryStatus
func (*SQLQueryResponse) GetTotalRows ¶
func (x *SQLQueryResponse) GetTotalRows() int32
func (*SQLQueryResponse) ProtoMessage ¶
func (*SQLQueryResponse) ProtoMessage()
func (*SQLQueryResponse) ProtoReflect ¶
func (x *SQLQueryResponse) ProtoReflect() protoreflect.Message
func (*SQLQueryResponse) Reset ¶
func (x *SQLQueryResponse) Reset()
func (*SQLQueryResponse) String ¶
func (x *SQLQueryResponse) String() string
type SQLQueryStatus ¶
type SQLQueryStatus int32
const ( SQLQueryStatus_success SQLQueryStatus = 0 SQLQueryStatus_failed SQLQueryStatus = 1 )
func (SQLQueryStatus) Descriptor ¶
func (SQLQueryStatus) Descriptor() protoreflect.EnumDescriptor
func (SQLQueryStatus) Enum ¶
func (x SQLQueryStatus) Enum() *SQLQueryStatus
func (SQLQueryStatus) EnumDescriptor
deprecated
func (SQLQueryStatus) EnumDescriptor() ([]byte, []int)
Deprecated: Use SQLQueryStatus.Descriptor instead.
func (SQLQueryStatus) Number ¶
func (x SQLQueryStatus) Number() protoreflect.EnumNumber
func (SQLQueryStatus) String ¶
func (x SQLQueryStatus) String() string
func (SQLQueryStatus) Type ¶
func (SQLQueryStatus) Type() protoreflect.EnumType
type TraceItem ¶
type TraceItem struct { TraceId string `protobuf:"bytes,1,opt,name=trace_id,json=traceId,proto3" json:"trace_id,omitempty"` EnvironmentId string `protobuf:"bytes,2,opt,name=environment_id,json=environmentId,proto3" json:"environment_id,omitempty"` StartTime *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"` EndTime *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=end_time,json=endTime,proto3" json:"end_time,omitempty"` Error bool `protobuf:"varint,5,opt,name=error,proto3" json:"error,omitempty"` DurationMs float32 `protobuf:"fixed32,6,opt,name=duration_ms,json=durationMs,proto3" json:"duration_ms,omitempty"` RootName string `protobuf:"bytes,7,opt,name=root_name,json=rootName,proto3" json:"root_name,omitempty"` ProjectId string `protobuf:"bytes,8,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` DeploymentId string `protobuf:"bytes,9,opt,name=deployment_id,json=deploymentId,proto3" json:"deployment_id,omitempty"` RuntimeVersion string `protobuf:"bytes,10,opt,name=runtime_version,json=runtimeVersion,proto3" json:"runtime_version,omitempty"` // contains filtered or unexported fields }
func (*TraceItem) Descriptor
deprecated
func (*TraceItem) GetDeploymentId ¶
func (*TraceItem) GetDurationMs ¶
func (*TraceItem) GetEndTime ¶
func (x *TraceItem) GetEndTime() *timestamppb.Timestamp
func (*TraceItem) GetEnvironmentId ¶
func (*TraceItem) GetProjectId ¶
func (*TraceItem) GetRootName ¶
func (*TraceItem) GetRuntimeVersion ¶
func (*TraceItem) GetStartTime ¶
func (x *TraceItem) GetStartTime() *timestamppb.Timestamp
func (*TraceItem) GetTraceId ¶
func (*TraceItem) ProtoMessage ¶
func (*TraceItem) ProtoMessage()
func (*TraceItem) ProtoReflect ¶
func (x *TraceItem) ProtoReflect() protoreflect.Message
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 NewAPIServer ¶
func NewAPIServer(svc API, opts ...interface{}) TwirpServer
NewAPIServer 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).