daemonrpc

package
v0.0.0-...-b88123c Latest Latest
Warning

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

Go to latest
Published: May 1, 2023 License: Unlicense Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const DaemonPathPrefix = "/twirp/daemon.steady.Daemon/"

DaemonPathPrefix 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

View Source
var File_daemon_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 Application

type Application struct {
	Name         string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	RequestCount int64  `protobuf:"varint,2,opt,name=request_count,json=requestCount,proto3" json:"request_count,omitempty"`
	StartCount   int64  `protobuf:"varint,3,opt,name=start_count,json=startCount,proto3" json:"start_count,omitempty"`
	// contains filtered or unexported fields
}

func (*Application) Descriptor deprecated

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

Deprecated: Use Application.ProtoReflect.Descriptor instead.

func (*Application) GetName

func (x *Application) GetName() string

func (*Application) GetRequestCount

func (x *Application) GetRequestCount() int64

func (*Application) GetStartCount

func (x *Application) GetStartCount() int64

func (*Application) ProtoMessage

func (*Application) ProtoMessage()

func (*Application) ProtoReflect

func (x *Application) ProtoReflect() protoreflect.Message

func (*Application) Reset

func (x *Application) Reset()

func (*Application) String

func (x *Application) String() string

type CreateApplicationRequest

type CreateApplicationRequest struct {
	Name   string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Script string `protobuf:"bytes,2,opt,name=script,proto3" json:"script,omitempty"`
	// contains filtered or unexported fields
}

func (*CreateApplicationRequest) Descriptor deprecated

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

Deprecated: Use CreateApplicationRequest.ProtoReflect.Descriptor instead.

func (*CreateApplicationRequest) GetName

func (x *CreateApplicationRequest) GetName() string

func (*CreateApplicationRequest) GetScript

func (x *CreateApplicationRequest) GetScript() string

func (*CreateApplicationRequest) ProtoMessage

func (*CreateApplicationRequest) ProtoMessage()

func (*CreateApplicationRequest) ProtoReflect

func (x *CreateApplicationRequest) ProtoReflect() protoreflect.Message

func (*CreateApplicationRequest) Reset

func (x *CreateApplicationRequest) Reset()

func (*CreateApplicationRequest) String

func (x *CreateApplicationRequest) String() string

type Daemon

func NewDaemonJSONClient

func NewDaemonJSONClient(baseURL string, client HTTPClient, opts ...twirp.ClientOption) Daemon

NewDaemonJSONClient creates a JSON client that implements the Daemon interface. It communicates using JSON and can be configured with a custom HTTPClient.

func NewDaemonProtobufClient

func NewDaemonProtobufClient(baseURL string, client HTTPClient, opts ...twirp.ClientOption) Daemon

NewDaemonProtobufClient creates a Protobuf client that implements the Daemon interface. It communicates using Protobuf and can be configured with a custom HTTPClient.

type DeleteApplicationRequest

type DeleteApplicationRequest struct {
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// contains filtered or unexported fields
}

func (*DeleteApplicationRequest) Descriptor deprecated

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

Deprecated: Use DeleteApplicationRequest.ProtoReflect.Descriptor instead.

func (*DeleteApplicationRequest) GetName

func (x *DeleteApplicationRequest) GetName() string

func (*DeleteApplicationRequest) ProtoMessage

func (*DeleteApplicationRequest) ProtoMessage()

func (*DeleteApplicationRequest) ProtoReflect

func (x *DeleteApplicationRequest) ProtoReflect() protoreflect.Message

func (*DeleteApplicationRequest) Reset

func (x *DeleteApplicationRequest) Reset()

func (*DeleteApplicationRequest) String

func (x *DeleteApplicationRequest) String() string

type GetApplicationRequest

type GetApplicationRequest struct {
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// contains filtered or unexported fields
}

func (*GetApplicationRequest) Descriptor deprecated

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

Deprecated: Use GetApplicationRequest.ProtoReflect.Descriptor instead.

func (*GetApplicationRequest) GetName

func (x *GetApplicationRequest) GetName() string

func (*GetApplicationRequest) ProtoMessage

func (*GetApplicationRequest) ProtoMessage()

func (*GetApplicationRequest) ProtoReflect

func (x *GetApplicationRequest) ProtoReflect() protoreflect.Message

func (*GetApplicationRequest) Reset

func (x *GetApplicationRequest) Reset()

func (*GetApplicationRequest) String

func (x *GetApplicationRequest) String() string

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 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 NewDaemonServer

func NewDaemonServer(svc Daemon, opts ...interface{}) TwirpServer

NewDaemonServer 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).

type UpdateApplicationRequest

type UpdateApplicationRequest struct {
	Name   string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Script string `protobuf:"bytes,2,opt,name=script,proto3" json:"script,omitempty"`
	// contains filtered or unexported fields
}

func (*UpdateApplicationRequest) Descriptor deprecated

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

Deprecated: Use UpdateApplicationRequest.ProtoReflect.Descriptor instead.

func (*UpdateApplicationRequest) GetName

func (x *UpdateApplicationRequest) GetName() string

func (*UpdateApplicationRequest) GetScript

func (x *UpdateApplicationRequest) GetScript() string

func (*UpdateApplicationRequest) ProtoMessage

func (*UpdateApplicationRequest) ProtoMessage()

func (*UpdateApplicationRequest) ProtoReflect

func (x *UpdateApplicationRequest) ProtoReflect() protoreflect.Message

func (*UpdateApplicationRequest) Reset

func (x *UpdateApplicationRequest) Reset()

func (*UpdateApplicationRequest) String

func (x *UpdateApplicationRequest) String() string

type UpdateApplicationResponse

type UpdateApplicationResponse struct {
	Application *Application `protobuf:"bytes,1,opt,name=application,proto3" json:"application,omitempty"`
	// contains filtered or unexported fields
}

func (*UpdateApplicationResponse) Descriptor deprecated

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

Deprecated: Use UpdateApplicationResponse.ProtoReflect.Descriptor instead.

func (*UpdateApplicationResponse) GetApplication

func (x *UpdateApplicationResponse) GetApplication() *Application

func (*UpdateApplicationResponse) ProtoMessage

func (*UpdateApplicationResponse) ProtoMessage()

func (*UpdateApplicationResponse) ProtoReflect

func (*UpdateApplicationResponse) Reset

func (x *UpdateApplicationResponse) Reset()

func (*UpdateApplicationResponse) String

func (x *UpdateApplicationResponse) String() string

Jump to

Keyboard shortcuts

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