trigger

package
v0.8.3 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2021 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

Package trigger is a generated twirp stub package. This code was generated with github.com/twitchtv/twirp/protoc-gen-twirp v7.1.1.

It is generated from these files:

trigger.proto

Index

Constants

View Source
const TriggerPathPrefix = "/twirp/redsail.bosn.Trigger/"

TriggerPathPrefix is a convenience constant that could used to identify URL paths. Should be used with caution, it only matches routes generated by Twirp Go clients, that add a "/twirp" prefix by default, and use CamelCase service and method names. More info: https://twitchtv.github.io/twirp/docs/routing.html

Variables

View Source
var File_trigger_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 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 ManualTriggered

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

func (*ManualTriggered) Descriptor deprecated

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

Deprecated: Use ManualTriggered.ProtoReflect.Descriptor instead.

func (*ManualTriggered) GetRunUuid

func (x *ManualTriggered) GetRunUuid() string

func (*ManualTriggered) ProtoMessage

func (*ManualTriggered) ProtoMessage()

func (*ManualTriggered) ProtoReflect

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

func (*ManualTriggered) Reset

func (x *ManualTriggered) Reset()

func (*ManualTriggered) String

func (x *ManualTriggered) String() string

type Trigger

type Trigger interface {
	// triggers a deployment manually
	Manual(context.Context, *TriggerManual) (*ManualTriggered, error)

	// triggers a deployment from a web call
	Web(context.Context, *TriggerWeb) (*WebTriggered, error)
}

func NewTriggerJSONClient

func NewTriggerJSONClient(baseURL string, client HTTPClient, opts ...twirp.ClientOption) Trigger

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

func NewTriggerProtobufClient

func NewTriggerProtobufClient(baseURL string, client HTTPClient, opts ...twirp.ClientOption) Trigger

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

type TriggerManual

type TriggerManual struct {
	Uuid string `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"`
	Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	Args string `protobuf:"bytes,3,opt,name=args,proto3" json:"args,omitempty"`
	// contains filtered or unexported fields
}

func (*TriggerManual) Descriptor deprecated

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

Deprecated: Use TriggerManual.ProtoReflect.Descriptor instead.

func (*TriggerManual) GetArgs

func (x *TriggerManual) GetArgs() string

func (*TriggerManual) GetName

func (x *TriggerManual) GetName() string

func (*TriggerManual) GetUuid

func (x *TriggerManual) GetUuid() string

func (*TriggerManual) ProtoMessage

func (*TriggerManual) ProtoMessage()

func (*TriggerManual) ProtoReflect

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

func (*TriggerManual) Reset

func (x *TriggerManual) Reset()

func (*TriggerManual) String

func (x *TriggerManual) String() string

type TriggerWeb

type TriggerWeb struct {
	Uuid  string `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"`
	Name  string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	Token string `protobuf:"bytes,3,opt,name=token,proto3" json:"token,omitempty"`
	Args  string `protobuf:"bytes,4,opt,name=args,proto3" json:"args,omitempty"`
	// contains filtered or unexported fields
}

func (*TriggerWeb) Descriptor deprecated

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

Deprecated: Use TriggerWeb.ProtoReflect.Descriptor instead.

func (*TriggerWeb) GetArgs

func (x *TriggerWeb) GetArgs() string

func (*TriggerWeb) GetName

func (x *TriggerWeb) GetName() string

func (*TriggerWeb) GetToken

func (x *TriggerWeb) GetToken() string

func (*TriggerWeb) GetUuid

func (x *TriggerWeb) GetUuid() string

func (*TriggerWeb) ProtoMessage

func (*TriggerWeb) ProtoMessage()

func (*TriggerWeb) ProtoReflect

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

func (*TriggerWeb) Reset

func (x *TriggerWeb) Reset()

func (*TriggerWeb) String

func (x *TriggerWeb) String() string

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

	// 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 NewTriggerServer

func NewTriggerServer(svc Trigger, opts ...interface{}) TwirpServer

NewTriggerServer 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 WebTriggered

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

func (*WebTriggered) Descriptor deprecated

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

Deprecated: Use WebTriggered.ProtoReflect.Descriptor instead.

func (*WebTriggered) GetRunUuid

func (x *WebTriggered) GetRunUuid() string

func (*WebTriggered) ProtoMessage

func (*WebTriggered) ProtoMessage()

func (*WebTriggered) ProtoReflect

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

func (*WebTriggered) Reset

func (x *WebTriggered) Reset()

func (*WebTriggered) String

func (x *WebTriggered) String() string

Jump to

Keyboard shortcuts

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