trigger

package
v0.8.11 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 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 (
	TriggerStatus_name = map[int32]string{
		0: "NOT_STARTED",
		1: "IN_PROGRESS",
		2: "AWAITING_APPROVAL",
		3: "FAILED",
		4: "SUCCEEDED",
		5: "SKIPPED",
	}
	TriggerStatus_value = map[string]int32{
		"NOT_STARTED":       0,
		"IN_PROGRESS":       1,
		"AWAITING_APPROVAL": 2,
		"FAILED":            3,
		"SUCCEEDED":         4,
		"SKIPPED":           5,
	}
)

Enum value maps for TriggerStatus.

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 ReadStatus added in v0.8.5

type ReadStatus struct {
	DeploymentUuid  string `protobuf:"bytes,1,opt,name=deployment_uuid,json=deploymentUuid,proto3" json:"deployment_uuid,omitempty"`
	DeploymentToken string `protobuf:"bytes,2,opt,name=deployment_token,json=deploymentToken,proto3" json:"deployment_token,omitempty"`
	RunUuid         string `protobuf:"bytes,3,opt,name=run_uuid,json=runUuid,proto3" json:"run_uuid,omitempty"`
	// contains filtered or unexported fields
}

func (*ReadStatus) Descriptor deprecated added in v0.8.5

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

Deprecated: Use ReadStatus.ProtoReflect.Descriptor instead.

func (*ReadStatus) GetDeploymentToken added in v0.8.5

func (x *ReadStatus) GetDeploymentToken() string

func (*ReadStatus) GetDeploymentUuid added in v0.8.5

func (x *ReadStatus) GetDeploymentUuid() string

func (*ReadStatus) GetRunUuid added in v0.8.5

func (x *ReadStatus) GetRunUuid() string

func (*ReadStatus) ProtoMessage added in v0.8.5

func (*ReadStatus) ProtoMessage()

func (*ReadStatus) ProtoReflect added in v0.8.5

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

func (*ReadStatus) Reset added in v0.8.5

func (x *ReadStatus) Reset()

func (*ReadStatus) String added in v0.8.5

func (x *ReadStatus) String() string

type StatusRead added in v0.8.5

type StatusRead struct {
	Status TriggerStatus `protobuf:"varint,1,opt,name=status,proto3,enum=redsail.bosn.TriggerStatus" json:"status,omitempty"`
	// contains filtered or unexported fields
}

func (*StatusRead) Descriptor deprecated added in v0.8.5

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

Deprecated: Use StatusRead.ProtoReflect.Descriptor instead.

func (*StatusRead) GetStatus added in v0.8.5

func (x *StatusRead) GetStatus() TriggerStatus

func (*StatusRead) ProtoMessage added in v0.8.5

func (*StatusRead) ProtoMessage()

func (*StatusRead) ProtoReflect added in v0.8.5

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

func (*StatusRead) Reset added in v0.8.5

func (x *StatusRead) Reset()

func (*StatusRead) String added in v0.8.5

func (x *StatusRead) 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)

	// gets the status of a run
	Status(context.Context, *ReadStatus) (*StatusRead, 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 TriggerStatus added in v0.8.5

type TriggerStatus int32
const (
	TriggerStatus_NOT_STARTED       TriggerStatus = 0
	TriggerStatus_IN_PROGRESS       TriggerStatus = 1
	TriggerStatus_AWAITING_APPROVAL TriggerStatus = 2
	TriggerStatus_FAILED            TriggerStatus = 3
	TriggerStatus_SUCCEEDED         TriggerStatus = 4
	TriggerStatus_SKIPPED           TriggerStatus = 5
)

func (TriggerStatus) Descriptor added in v0.8.5

func (TriggerStatus) Enum added in v0.8.5

func (x TriggerStatus) Enum() *TriggerStatus

func (TriggerStatus) EnumDescriptor deprecated added in v0.8.5

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

Deprecated: Use TriggerStatus.Descriptor instead.

func (TriggerStatus) Number added in v0.8.5

func (TriggerStatus) String added in v0.8.5

func (x TriggerStatus) String() string

func (TriggerStatus) Type added in v0.8.5

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