api

package
v1.3.5 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2019 License: MIT Imports: 15 Imported by: 0

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

View Source
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

View Source
var Log_Level_name = map[int32]string{
	0: "DEBUG",
	1: "INFO",
	2: "WARN",
	3: "ERROR",
}
View Source
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) Descriptor() ([]byte, []int)

func (*Confirm) GetId

func (m *Confirm) GetId() string

func (*Confirm) GetLogs

func (m *Confirm) GetLogs() []*Log

func (*Confirm) GetProcessId

func (m *Confirm) GetProcessId() string

func (*Confirm) GetStatusCode

func (m *Confirm) GetStatusCode() int32

func (*Confirm) GetSuccess

func (m *Confirm) GetSuccess() bool

func (*Confirm) ProtoMessage

func (*Confirm) ProtoMessage()

func (*Confirm) Reset

func (m *Confirm) Reset()

func (*Confirm) String

func (m *Confirm) String() string

func (*Confirm) XXX_DiscardUnknown

func (m *Confirm) XXX_DiscardUnknown()

func (*Confirm) XXX_Marshal

func (m *Confirm) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Confirm) XXX_Merge

func (dst *Confirm) XXX_Merge(src proto.Message)

func (*Confirm) XXX_Size

func (m *Confirm) XXX_Size() int

func (*Confirm) XXX_Unmarshal

func (m *Confirm) XXX_Unmarshal(b []byte) error

type Empty

type Empty struct {
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Empty) Descriptor

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

func (*Empty) ProtoMessage

func (*Empty) ProtoMessage()

func (*Empty) Reset

func (m *Empty) Reset()

func (*Empty) String

func (m *Empty) String() string

func (*Empty) XXX_DiscardUnknown

func (m *Empty) XXX_DiscardUnknown()

func (*Empty) XXX_Marshal

func (m *Empty) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Empty) XXX_Merge

func (dst *Empty) XXX_Merge(src proto.Message)

func (*Empty) XXX_Size

func (m *Empty) XXX_Size() int

func (*Empty) XXX_Unmarshal

func (m *Empty) XXX_Unmarshal(b []byte) error

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 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) Descriptor() ([]byte, []int)

func (*Log) GetDescription

func (m *Log) GetDescription() string

func (*Log) GetLevel

func (m *Log) GetLevel() Log_Level

func (*Log) ProtoMessage

func (*Log) ProtoMessage()

func (*Log) Reset

func (m *Log) Reset()

func (*Log) String

func (m *Log) String() string

func (*Log) XXX_DiscardUnknown

func (m *Log) XXX_DiscardUnknown()

func (*Log) XXX_Marshal

func (m *Log) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Log) XXX_Merge

func (dst *Log) XXX_Merge(src proto.Message)

func (*Log) XXX_Size

func (m *Log) XXX_Size() int

func (*Log) XXX_Unmarshal

func (m *Log) XXX_Unmarshal(b []byte) error

type Log_Level

type Log_Level int32
const (
	Log_DEBUG Log_Level = 0
	Log_INFO  Log_Level = 1
	Log_WARN  Log_Level = 2
	Log_ERROR Log_Level = 3
)

func (Log_Level) EnumDescriptor

func (Log_Level) EnumDescriptor() ([]byte, []int)

func (Log_Level) String

func (x Log_Level) String() string

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) Descriptor() ([]byte, []int)

func (*Message) GetAttachments

func (m *Message) GetAttachments() []*Attachment

func (*Message) GetContent

func (m *Message) GetContent() []byte

func (*Message) GetId

func (m *Message) GetId() string

func (*Message) GetProcessId

func (m *Message) GetProcessId() string

func (*Message) GetProperties

func (m *Message) GetProperties() map[string]string

func (*Message) GetTest

func (m *Message) GetTest() bool

func (*Message) ProtoMessage

func (*Message) ProtoMessage()

func (*Message) Reset

func (m *Message) Reset()

func (*Message) String

func (m *Message) String() string

func (*Message) XXX_DiscardUnknown

func (m *Message) XXX_DiscardUnknown()

func (*Message) XXX_Marshal

func (m *Message) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Message) XXX_Merge

func (dst *Message) XXX_Merge(src proto.Message)

func (*Message) XXX_Size

func (m *Message) XXX_Size() int

func (*Message) XXX_Unmarshal

func (m *Message) XXX_Unmarshal(b []byte) error

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) Descriptor() ([]byte, []int)

func (*Messages) GetMessages

func (m *Messages) GetMessages() []*Message

func (*Messages) ProtoMessage

func (*Messages) ProtoMessage()

func (*Messages) Reset

func (m *Messages) Reset()

func (*Messages) String

func (m *Messages) String() string

func (*Messages) XXX_DiscardUnknown

func (m *Messages) XXX_DiscardUnknown()

func (*Messages) XXX_Marshal

func (m *Messages) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Messages) XXX_Merge

func (dst *Messages) XXX_Merge(src proto.Message)

func (*Messages) XXX_Size

func (m *Messages) XXX_Size() int

func (*Messages) XXX_Unmarshal

func (m *Messages) XXX_Unmarshal(b []byte) error

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

Jump to

Keyboard shortcuts

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