Documentation ¶
Overview ¶
Package api is a generated twirp stub package. This code was generated with github.com/twitchtv/twirp/protoc-gen-twirp v5.4.1.
It is generated from these files:
api.proto
Index ¶
- Constants
- Variables
- func WriteError(resp http.ResponseWriter, err error)
- type Attachment
- func (*Attachment) Descriptor() ([]byte, []int)
- func (m *Attachment) GetContent() isAttachment_Content
- func (m *Attachment) GetContentType() string
- func (m *Attachment) GetData() []byte
- func (m *Attachment) GetDescription() string
- func (m *Attachment) GetFilename() string
- func (m *Attachment) GetUrl() string
- func (m *Attachment) GetVersion() string
- func (*Attachment) ProtoMessage()
- func (m *Attachment) Reset()
- func (m *Attachment) String() string
- func (m *Attachment) XXX_DiscardUnknown()
- func (m *Attachment) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *Attachment) XXX_Merge(src proto.Message)
- func (*Attachment) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, ...)
- func (m *Attachment) XXX_Size() int
- func (m *Attachment) XXX_Unmarshal(b []byte) error
- type Attachment_Data
- type Attachment_Url
- type ClientService
- type Configuration
- func (*Configuration) Descriptor() ([]byte, []int)
- func (m *Configuration) GetInbound() []*ProcessConfig
- func (m *Configuration) GetOutbound() []*ProcessConfig
- func (*Configuration) ProtoMessage()
- func (m *Configuration) Reset()
- func (m *Configuration) String() string
- func (m *Configuration) XXX_DiscardUnknown()
- func (m *Configuration) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *Configuration) XXX_Merge(src proto.Message)
- func (m *Configuration) XXX_Size() int
- func (m *Configuration) XXX_Unmarshal(b []byte) error
- type Confirm
- func (*Confirm) Descriptor() ([]byte, []int)
- func (m *Confirm) GetId() string
- func (m *Confirm) GetLogs() []*Log
- func (m *Confirm) GetProcessId() string
- func (m *Confirm) GetStatusCode() int32
- func (m *Confirm) GetSuccess() bool
- func (*Confirm) ProtoMessage()
- func (m *Confirm) Reset()
- func (m *Confirm) String() string
- func (m *Confirm) XXX_DiscardUnknown()
- func (m *Confirm) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *Confirm) XXX_Merge(src proto.Message)
- func (m *Confirm) XXX_Size() int
- func (m *Confirm) XXX_Unmarshal(b []byte) error
- type Empty
- func (*Empty) Descriptor() ([]byte, []int)
- func (*Empty) ProtoMessage()
- func (m *Empty) Reset()
- func (m *Empty) String() string
- func (m *Empty) XXX_DiscardUnknown()
- func (m *Empty) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *Empty) XXX_Merge(src proto.Message)
- func (m *Empty) XXX_Size() int
- func (m *Empty) XXX_Unmarshal(b []byte) error
- type HTTPClient
- type HealthInfo
- func (*HealthInfo) Descriptor() ([]byte, []int)
- func (m *HealthInfo) GetCpu() float64
- func (m *HealthInfo) GetOs() string
- func (m *HealthInfo) GetRam() float64
- func (m *HealthInfo) GetStatus() string
- func (m *HealthInfo) GetThreads() uint32
- func (m *HealthInfo) GetUptime() uint64
- func (*HealthInfo) ProtoMessage()
- func (m *HealthInfo) Reset()
- func (m *HealthInfo) String() string
- func (m *HealthInfo) XXX_DiscardUnknown()
- func (m *HealthInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *HealthInfo) XXX_Merge(src proto.Message)
- func (m *HealthInfo) XXX_Size() int
- func (m *HealthInfo) XXX_Unmarshal(b []byte) error
- type Log
- func (*Log) Descriptor() ([]byte, []int)
- func (m *Log) GetDescription() string
- func (m *Log) GetLevel() Log_Level
- func (*Log) ProtoMessage()
- func (m *Log) Reset()
- func (m *Log) String() string
- func (m *Log) XXX_DiscardUnknown()
- func (m *Log) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *Log) XXX_Merge(src proto.Message)
- func (m *Log) XXX_Size() int
- func (m *Log) XXX_Unmarshal(b []byte) error
- type Log_Level
- type Message
- func (*Message) Descriptor() ([]byte, []int)
- func (m *Message) GetAttachments() []*Attachment
- func (m *Message) GetContent() []byte
- func (m *Message) GetId() string
- func (m *Message) GetProcessId() string
- func (m *Message) GetProperties() map[string]string
- func (m *Message) GetTest() bool
- func (*Message) ProtoMessage()
- func (m *Message) Reset()
- func (m *Message) String() string
- func (m *Message) XXX_DiscardUnknown()
- func (m *Message) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *Message) XXX_Merge(src proto.Message)
- func (m *Message) XXX_Size() int
- func (m *Message) XXX_Unmarshal(b []byte) error
- type Messages
- func (*Messages) Descriptor() ([]byte, []int)
- func (m *Messages) GetMessages() []*Message
- func (*Messages) ProtoMessage()
- func (m *Messages) Reset()
- func (m *Messages) String() string
- func (m *Messages) XXX_DiscardUnknown()
- func (m *Messages) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *Messages) XXX_Merge(src proto.Message)
- func (m *Messages) XXX_Size() int
- func (m *Messages) XXX_Unmarshal(b []byte) error
- type ProcessConfig
- func (*ProcessConfig) Descriptor() ([]byte, []int)
- func (m *ProcessConfig) GetParameter() map[string]string
- func (m *ProcessConfig) GetProcessId() string
- func (m *ProcessConfig) GetType() string
- func (*ProcessConfig) ProtoMessage()
- func (m *ProcessConfig) Reset()
- func (m *ProcessConfig) String() string
- func (m *ProcessConfig) XXX_DiscardUnknown()
- func (m *ProcessConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *ProcessConfig) XXX_Merge(src proto.Message)
- func (m *ProcessConfig) XXX_Size() int
- func (m *ProcessConfig) XXX_Unmarshal(b []byte) error
- type TwirpServer
Constants ¶
const ClientServicePathPrefix = "/v1/api.ClientService/"
ClientServicePathPrefix is used for all URL paths on a twirp ClientService server. Requests are always: POST ClientServicePathPrefix/method It can be used in an HTTP mux to route twirp requests along with non-twirp requests on other routes.
Variables ¶
var Log_Level_name = map[int32]string{
0: "DEBUG",
1: "INFO",
2: "WARN",
3: "ERROR",
}
var Log_Level_value = map[string]int32{
"DEBUG": 0,
"INFO": 1,
"WARN": 2,
"ERROR": 3,
}
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 Attachment ¶
type Attachment struct { Filename string `protobuf:"bytes,1,opt,name=filename,proto3" json:"filename,omitempty"` ContentType string `protobuf:"bytes,2,opt,name=content_type,json=contentType,proto3" json:"content_type,omitempty"` Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` Version string `protobuf:"bytes,4,opt,name=version,proto3" json:"version,omitempty"` // Types that are valid to be assigned to Content: // *Attachment_Data // *Attachment_Url Content isAttachment_Content `protobuf_oneof:"content"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*Attachment) Descriptor ¶
func (*Attachment) Descriptor() ([]byte, []int)
func (*Attachment) GetContent ¶
func (m *Attachment) GetContent() isAttachment_Content
func (*Attachment) GetContentType ¶
func (m *Attachment) GetContentType() string
func (*Attachment) GetData ¶
func (m *Attachment) GetData() []byte
func (*Attachment) GetDescription ¶
func (m *Attachment) GetDescription() string
func (*Attachment) GetFilename ¶
func (m *Attachment) GetFilename() string
func (*Attachment) GetUrl ¶
func (m *Attachment) GetUrl() string
func (*Attachment) GetVersion ¶
func (m *Attachment) GetVersion() string
func (*Attachment) ProtoMessage ¶
func (*Attachment) ProtoMessage()
func (*Attachment) Reset ¶
func (m *Attachment) Reset()
func (*Attachment) String ¶
func (m *Attachment) String() string
func (*Attachment) XXX_DiscardUnknown ¶
func (m *Attachment) XXX_DiscardUnknown()
func (*Attachment) XXX_Marshal ¶
func (m *Attachment) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*Attachment) XXX_Merge ¶
func (dst *Attachment) XXX_Merge(src proto.Message)
func (*Attachment) XXX_OneofFuncs ¶
func (*Attachment) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{})
XXX_OneofFuncs is for the internal use of the proto package.
func (*Attachment) XXX_Size ¶
func (m *Attachment) XXX_Size() int
func (*Attachment) XXX_Unmarshal ¶
func (m *Attachment) XXX_Unmarshal(b []byte) error
type Attachment_Data ¶
type Attachment_Data struct {
Data []byte `protobuf:"bytes,5,opt,name=data,proto3,oneof"`
}
type Attachment_Url ¶
type Attachment_Url struct {
Url string `protobuf:"bytes,6,opt,name=url,proto3,oneof"`
}
type ClientService ¶
type ClientService interface { ListConfigs(context.Context, *Empty) (*Configuration, error) AddAttachment(context.Context, *Attachment) (*Confirm, error) AddMessage(context.Context, *Message) (*Confirm, error) ListMessages(context.Context, *Empty) (*Messages, error) ConfirmMessage(context.Context, *Confirm) (*Empty, error) AddHealth(context.Context, *HealthInfo) (*Empty, error) }
func NewClientServiceJSONClient ¶
func NewClientServiceJSONClient(addr string, client HTTPClient) ClientService
NewClientServiceJSONClient creates a JSON client that implements the ClientService interface. It communicates using JSON and can be configured with a custom HTTPClient.
func NewClientServiceProtobufClient ¶
func NewClientServiceProtobufClient(addr string, client HTTPClient) ClientService
NewClientServiceProtobufClient creates a Protobuf client that implements the ClientService interface. It communicates using Protobuf and can be configured with a custom HTTPClient.
type Configuration ¶
type Configuration struct { Inbound []*ProcessConfig `protobuf:"bytes,1,rep,name=inbound,proto3" json:"inbound,omitempty"` Outbound []*ProcessConfig `protobuf:"bytes,2,rep,name=outbound,proto3" json:"outbound,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*Configuration) Descriptor ¶
func (*Configuration) Descriptor() ([]byte, []int)
func (*Configuration) GetInbound ¶
func (m *Configuration) GetInbound() []*ProcessConfig
func (*Configuration) GetOutbound ¶
func (m *Configuration) GetOutbound() []*ProcessConfig
func (*Configuration) ProtoMessage ¶
func (*Configuration) ProtoMessage()
func (*Configuration) Reset ¶
func (m *Configuration) Reset()
func (*Configuration) String ¶
func (m *Configuration) String() string
func (*Configuration) XXX_DiscardUnknown ¶
func (m *Configuration) XXX_DiscardUnknown()
func (*Configuration) XXX_Marshal ¶
func (m *Configuration) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*Configuration) XXX_Merge ¶
func (dst *Configuration) XXX_Merge(src proto.Message)
func (*Configuration) XXX_Size ¶
func (m *Configuration) XXX_Size() int
func (*Configuration) XXX_Unmarshal ¶
func (m *Configuration) XXX_Unmarshal(b []byte) error
type Confirm ¶
type Confirm struct { ProcessId string `protobuf:"bytes,1,opt,name=process_id,json=processId,proto3" json:"process_id,omitempty"` Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` Success bool `protobuf:"varint,3,opt,name=success,proto3" json:"success,omitempty"` Logs []*Log `protobuf:"bytes,4,rep,name=logs,proto3" json:"logs,omitempty"` StatusCode int32 `protobuf:"varint,5,opt,name=status_code,json=statusCode,proto3" json:"status_code,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
Confirmation of a message
func (*Confirm) Descriptor ¶
func (*Confirm) GetProcessId ¶
func (*Confirm) GetStatusCode ¶
func (*Confirm) GetSuccess ¶
func (*Confirm) ProtoMessage ¶
func (*Confirm) ProtoMessage()
func (*Confirm) XXX_DiscardUnknown ¶
func (m *Confirm) XXX_DiscardUnknown()
func (*Confirm) XXX_Marshal ¶
func (*Confirm) XXX_Unmarshal ¶
type Empty ¶
type Empty struct { XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*Empty) Descriptor ¶
func (*Empty) ProtoMessage ¶
func (*Empty) ProtoMessage()
func (*Empty) XXX_DiscardUnknown ¶
func (m *Empty) XXX_DiscardUnknown()
func (*Empty) XXX_Marshal ¶
func (*Empty) XXX_Unmarshal ¶
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 HealthInfo ¶
type HealthInfo struct { Cpu float64 `protobuf:"fixed64,1,opt,name=cpu,proto3" json:"cpu,omitempty"` Ram float64 `protobuf:"fixed64,2,opt,name=ram,proto3" json:"ram,omitempty"` Status string `protobuf:"bytes,3,opt,name=status,proto3" json:"status,omitempty"` Threads uint32 `protobuf:"varint,4,opt,name=threads,proto3" json:"threads,omitempty"` Uptime uint64 `protobuf:"varint,5,opt,name=uptime,proto3" json:"uptime,omitempty"` Os string `protobuf:"bytes,6,opt,name=os,proto3" json:"os,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*HealthInfo) Descriptor ¶
func (*HealthInfo) Descriptor() ([]byte, []int)
func (*HealthInfo) GetCpu ¶
func (m *HealthInfo) GetCpu() float64
func (*HealthInfo) GetOs ¶
func (m *HealthInfo) GetOs() string
func (*HealthInfo) GetRam ¶
func (m *HealthInfo) GetRam() float64
func (*HealthInfo) GetStatus ¶
func (m *HealthInfo) GetStatus() string
func (*HealthInfo) GetThreads ¶
func (m *HealthInfo) GetThreads() uint32
func (*HealthInfo) GetUptime ¶
func (m *HealthInfo) GetUptime() uint64
func (*HealthInfo) ProtoMessage ¶
func (*HealthInfo) ProtoMessage()
func (*HealthInfo) Reset ¶
func (m *HealthInfo) Reset()
func (*HealthInfo) String ¶
func (m *HealthInfo) String() string
func (*HealthInfo) XXX_DiscardUnknown ¶
func (m *HealthInfo) XXX_DiscardUnknown()
func (*HealthInfo) XXX_Marshal ¶
func (m *HealthInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*HealthInfo) XXX_Merge ¶
func (dst *HealthInfo) XXX_Merge(src proto.Message)
func (*HealthInfo) XXX_Size ¶
func (m *HealthInfo) XXX_Size() int
func (*HealthInfo) XXX_Unmarshal ¶
func (m *HealthInfo) XXX_Unmarshal(b []byte) error
type Log ¶
type Log struct { Level Log_Level `protobuf:"varint,1,opt,name=level,proto3,enum=api.Log_Level" json:"level,omitempty"` Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*Log) Descriptor ¶
func (*Log) GetDescription ¶
func (*Log) ProtoMessage ¶
func (*Log) ProtoMessage()
func (*Log) XXX_DiscardUnknown ¶
func (m *Log) XXX_DiscardUnknown()
func (*Log) XXX_Unmarshal ¶
type Message ¶
type Message struct { ProcessId string `protobuf:"bytes,1,opt,name=process_id,json=processId,proto3" json:"process_id,omitempty"` Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` Test bool `protobuf:"varint,3,opt,name=test,proto3" json:"test,omitempty"` Properties map[string]string `` /* 161-byte string literal not displayed */ Content []byte `protobuf:"bytes,5,opt,name=content,proto3" json:"content,omitempty"` Attachments []*Attachment `protobuf:"bytes,6,rep,name=attachments,proto3" json:"attachments,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
Message is a edi message with extra information
func (*Message) Descriptor ¶
func (*Message) GetAttachments ¶
func (m *Message) GetAttachments() []*Attachment
func (*Message) GetContent ¶
func (*Message) GetProcessId ¶
func (*Message) GetProperties ¶
func (*Message) ProtoMessage ¶
func (*Message) ProtoMessage()
func (*Message) XXX_DiscardUnknown ¶
func (m *Message) XXX_DiscardUnknown()
func (*Message) XXX_Marshal ¶
func (*Message) XXX_Unmarshal ¶
type Messages ¶
type Messages struct { Messages []*Message `protobuf:"bytes,1,rep,name=messages,proto3" json:"messages,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
List of Messages
func (*Messages) Descriptor ¶
func (*Messages) GetMessages ¶
func (*Messages) ProtoMessage ¶
func (*Messages) ProtoMessage()
func (*Messages) XXX_DiscardUnknown ¶
func (m *Messages) XXX_DiscardUnknown()
func (*Messages) XXX_Marshal ¶
func (*Messages) XXX_Unmarshal ¶
type ProcessConfig ¶
type ProcessConfig struct { ProcessId string `protobuf:"bytes,1,opt,name=process_id,json=processId,proto3" json:"process_id,omitempty"` Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` Parameter map[string]string `` /* 159-byte string literal not displayed */ XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*ProcessConfig) Descriptor ¶
func (*ProcessConfig) Descriptor() ([]byte, []int)
func (*ProcessConfig) GetParameter ¶
func (m *ProcessConfig) GetParameter() map[string]string
func (*ProcessConfig) GetProcessId ¶
func (m *ProcessConfig) GetProcessId() string
func (*ProcessConfig) GetType ¶
func (m *ProcessConfig) GetType() string
func (*ProcessConfig) ProtoMessage ¶
func (*ProcessConfig) ProtoMessage()
func (*ProcessConfig) Reset ¶
func (m *ProcessConfig) Reset()
func (*ProcessConfig) String ¶
func (m *ProcessConfig) String() string
func (*ProcessConfig) XXX_DiscardUnknown ¶
func (m *ProcessConfig) XXX_DiscardUnknown()
func (*ProcessConfig) XXX_Marshal ¶
func (m *ProcessConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ProcessConfig) XXX_Merge ¶
func (dst *ProcessConfig) XXX_Merge(src proto.Message)
func (*ProcessConfig) XXX_Size ¶
func (m *ProcessConfig) XXX_Size() int
func (*ProcessConfig) XXX_Unmarshal ¶
func (m *ProcessConfig) XXX_Unmarshal(b []byte) error
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 NewClientServiceServer ¶
func NewClientServiceServer(svc ClientService, hooks *twirp.ServerHooks) TwirpServer