litterboxsvc

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: May 24, 2022 License: MIT Imports: 31 Imported by: 0

Documentation

Overview

Package litterboxsvc is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var File_litterboxsvc_svc_proto protoreflect.FileDescriptor
View Source
var LitterBox_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "autokitteh.litterbox.LitterBox",
	HandlerType: (*LitterBoxServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Setup",
			Handler:    _LitterBox_Setup_Handler,
		},
		{
			MethodName: "Scoop",
			Handler:    _LitterBox_Scoop_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "Run",
			Handler:       _LitterBox_Run_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "litterboxsvc/svc.proto",
}

LitterBox_ServiceDesc is the grpc.ServiceDesc for LitterBox service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterLitterBoxHandler

func RegisterLitterBoxHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterLitterBoxHandler registers the http handlers for service LitterBox to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterLitterBoxHandlerClient

func RegisterLitterBoxHandlerClient(ctx context.Context, mux *runtime.ServeMux, client LitterBoxClient) error

RegisterLitterBoxHandlerClient registers the http handlers for service LitterBox to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "LitterBoxClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "LitterBoxClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "LitterBoxClient" to call the correct interceptors.

func RegisterLitterBoxHandlerFromEndpoint

func RegisterLitterBoxHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterLitterBoxHandlerFromEndpoint is same as RegisterLitterBoxHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterLitterBoxHandlerServer

func RegisterLitterBoxHandlerServer(ctx context.Context, mux *runtime.ServeMux, server LitterBoxServer) error

RegisterLitterBoxHandlerServer registers the http handlers for service LitterBox to "mux". UnaryRPC :call LitterBoxServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterLitterBoxHandlerFromEndpoint instead.

func RegisterLitterBoxServer

func RegisterLitterBoxServer(s grpc.ServiceRegistrar, srv LitterBoxServer)

Types

type LitterBoxClient

type LitterBoxClient interface {
	Setup(ctx context.Context, in *SetupRequest, opts ...grpc.CallOption) (*SetupResponse, error)
	Run(ctx context.Context, in *RunRequest, opts ...grpc.CallOption) (LitterBox_RunClient, error)
	Scoop(ctx context.Context, in *ScoopRequest, opts ...grpc.CallOption) (*ScoopResponse, error)
}

LitterBoxClient is the client API for LitterBox service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

func NewLitterBoxClient

func NewLitterBoxClient(cc grpc.ClientConnInterface) LitterBoxClient

type LitterBoxServer

type LitterBoxServer interface {
	Setup(context.Context, *SetupRequest) (*SetupResponse, error)
	Run(*RunRequest, LitterBox_RunServer) error
	Scoop(context.Context, *ScoopRequest) (*ScoopResponse, error)
	// contains filtered or unexported methods
}

LitterBoxServer is the server API for LitterBox service. All implementations must embed UnimplementedLitterBoxServer for forward compatibility

type LitterBox_RunClient

type LitterBox_RunClient interface {
	Recv() (*RunUpdate, error)
	grpc.ClientStream
}

type LitterBox_RunServer

type LitterBox_RunServer interface {
	Send(*RunUpdate) error
	grpc.ServerStream
}

type RunRequest

type RunRequest struct {

	// If id is empty, run will setup, use and scoop the litterbox by itself.
	Id     string          `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Source string          `protobuf:"bytes,2,opt,name=source,proto3" json:"source,omitempty"`
	Event  *SyntheticEvent `protobuf:"bytes,3,opt,name=event,proto3" json:"event,omitempty"`
	// contains filtered or unexported fields
}

func (*RunRequest) Descriptor deprecated

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

Deprecated: Use RunRequest.ProtoReflect.Descriptor instead.

func (*RunRequest) GetEvent

func (x *RunRequest) GetEvent() *SyntheticEvent

func (*RunRequest) GetId

func (x *RunRequest) GetId() string

func (*RunRequest) GetSource

func (x *RunRequest) GetSource() string

func (*RunRequest) ProtoMessage

func (*RunRequest) ProtoMessage()

func (*RunRequest) ProtoReflect

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

func (*RunRequest) Reset

func (x *RunRequest) Reset()

func (*RunRequest) String

func (x *RunRequest) String() string

func (*RunRequest) Validate

func (m *RunRequest) Validate() error

Validate checks the field values on RunRequest with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.

type RunRequestValidationError

type RunRequestValidationError struct {
	// contains filtered or unexported fields
}

RunRequestValidationError is the validation error returned by RunRequest.Validate if the designated constraints aren't met.

func (RunRequestValidationError) Cause

func (e RunRequestValidationError) Cause() error

Cause function returns cause value.

func (RunRequestValidationError) Error

Error satisfies the builtin error interface

func (RunRequestValidationError) ErrorName

func (e RunRequestValidationError) ErrorName() string

ErrorName returns error name.

func (RunRequestValidationError) Field

Field function returns field value.

func (RunRequestValidationError) Key

Key function returns key value.

func (RunRequestValidationError) Reason

func (e RunRequestValidationError) Reason() string

Reason function returns reason value.

type RunUpdate

type RunUpdate struct {
	T     *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=t,proto3" json:"t,omitempty"`
	Id    string                 `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"`
	State *lang.RunState         `protobuf:"bytes,3,opt,name=state,proto3" json:"state,omitempty"`
	// contains filtered or unexported fields
}

func (*RunUpdate) Descriptor deprecated

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

Deprecated: Use RunUpdate.ProtoReflect.Descriptor instead.

func (*RunUpdate) GetId

func (x *RunUpdate) GetId() string

func (*RunUpdate) GetState

func (x *RunUpdate) GetState() *lang.RunState

func (*RunUpdate) GetT

func (x *RunUpdate) GetT() *timestamppb.Timestamp

func (*RunUpdate) ProtoMessage

func (*RunUpdate) ProtoMessage()

func (*RunUpdate) ProtoReflect

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

func (*RunUpdate) Reset

func (x *RunUpdate) Reset()

func (*RunUpdate) String

func (x *RunUpdate) String() string

func (*RunUpdate) Validate

func (m *RunUpdate) Validate() error

Validate checks the field values on RunUpdate with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.

type RunUpdateValidationError

type RunUpdateValidationError struct {
	// contains filtered or unexported fields
}

RunUpdateValidationError is the validation error returned by RunUpdate.Validate if the designated constraints aren't met.

func (RunUpdateValidationError) Cause

func (e RunUpdateValidationError) Cause() error

Cause function returns cause value.

func (RunUpdateValidationError) Error

func (e RunUpdateValidationError) Error() string

Error satisfies the builtin error interface

func (RunUpdateValidationError) ErrorName

func (e RunUpdateValidationError) ErrorName() string

ErrorName returns error name.

func (RunUpdateValidationError) Field

func (e RunUpdateValidationError) Field() string

Field function returns field value.

func (RunUpdateValidationError) Key

Key function returns key value.

func (RunUpdateValidationError) Reason

func (e RunUpdateValidationError) Reason() string

Reason function returns reason value.

type ScoopRequest

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

func (*ScoopRequest) Descriptor deprecated

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

Deprecated: Use ScoopRequest.ProtoReflect.Descriptor instead.

func (*ScoopRequest) GetId

func (x *ScoopRequest) GetId() string

func (*ScoopRequest) ProtoMessage

func (*ScoopRequest) ProtoMessage()

func (*ScoopRequest) ProtoReflect

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

func (*ScoopRequest) Reset

func (x *ScoopRequest) Reset()

func (*ScoopRequest) String

func (x *ScoopRequest) String() string

func (*ScoopRequest) Validate

func (m *ScoopRequest) Validate() error

Validate checks the field values on ScoopRequest with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.

type ScoopRequestValidationError

type ScoopRequestValidationError struct {
	// contains filtered or unexported fields
}

ScoopRequestValidationError is the validation error returned by ScoopRequest.Validate if the designated constraints aren't met.

func (ScoopRequestValidationError) Cause

Cause function returns cause value.

func (ScoopRequestValidationError) Error

Error satisfies the builtin error interface

func (ScoopRequestValidationError) ErrorName

func (e ScoopRequestValidationError) ErrorName() string

ErrorName returns error name.

func (ScoopRequestValidationError) Field

Field function returns field value.

func (ScoopRequestValidationError) Key

Key function returns key value.

func (ScoopRequestValidationError) Reason

Reason function returns reason value.

type ScoopResponse

type ScoopResponse struct {
	// contains filtered or unexported fields
}

func (*ScoopResponse) Descriptor deprecated

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

Deprecated: Use ScoopResponse.ProtoReflect.Descriptor instead.

func (*ScoopResponse) ProtoMessage

func (*ScoopResponse) ProtoMessage()

func (*ScoopResponse) ProtoReflect

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

func (*ScoopResponse) Reset

func (x *ScoopResponse) Reset()

func (*ScoopResponse) String

func (x *ScoopResponse) String() string

func (*ScoopResponse) Validate

func (m *ScoopResponse) Validate() error

Validate checks the field values on ScoopResponse with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.

type ScoopResponseValidationError

type ScoopResponseValidationError struct {
	// contains filtered or unexported fields
}

ScoopResponseValidationError is the validation error returned by ScoopResponse.Validate if the designated constraints aren't met.

func (ScoopResponseValidationError) Cause

Cause function returns cause value.

func (ScoopResponseValidationError) Error

Error satisfies the builtin error interface

func (ScoopResponseValidationError) ErrorName

func (e ScoopResponseValidationError) ErrorName() string

ErrorName returns error name.

func (ScoopResponseValidationError) Field

Field function returns field value.

func (ScoopResponseValidationError) Key

Key function returns key value.

func (ScoopResponseValidationError) Reason

Reason function returns reason value.

type SetupRequest

type SetupRequest struct {
	// contains filtered or unexported fields
}

func (*SetupRequest) Descriptor deprecated

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

Deprecated: Use SetupRequest.ProtoReflect.Descriptor instead.

func (*SetupRequest) ProtoMessage

func (*SetupRequest) ProtoMessage()

func (*SetupRequest) ProtoReflect

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

func (*SetupRequest) Reset

func (x *SetupRequest) Reset()

func (*SetupRequest) String

func (x *SetupRequest) String() string

func (*SetupRequest) Validate

func (m *SetupRequest) Validate() error

Validate checks the field values on SetupRequest with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.

type SetupRequestValidationError

type SetupRequestValidationError struct {
	// contains filtered or unexported fields
}

SetupRequestValidationError is the validation error returned by SetupRequest.Validate if the designated constraints aren't met.

func (SetupRequestValidationError) Cause

Cause function returns cause value.

func (SetupRequestValidationError) Error

Error satisfies the builtin error interface

func (SetupRequestValidationError) ErrorName

func (e SetupRequestValidationError) ErrorName() string

ErrorName returns error name.

func (SetupRequestValidationError) Field

Field function returns field value.

func (SetupRequestValidationError) Key

Key function returns key value.

func (SetupRequestValidationError) Reason

Reason function returns reason value.

type SetupResponse

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

func (*SetupResponse) Descriptor deprecated

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

Deprecated: Use SetupResponse.ProtoReflect.Descriptor instead.

func (*SetupResponse) GetId

func (x *SetupResponse) GetId() string

func (*SetupResponse) ProtoMessage

func (*SetupResponse) ProtoMessage()

func (*SetupResponse) ProtoReflect

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

func (*SetupResponse) Reset

func (x *SetupResponse) Reset()

func (*SetupResponse) String

func (x *SetupResponse) String() string

func (*SetupResponse) Validate

func (m *SetupResponse) Validate() error

Validate checks the field values on SetupResponse with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.

type SetupResponseValidationError

type SetupResponseValidationError struct {
	// contains filtered or unexported fields
}

SetupResponseValidationError is the validation error returned by SetupResponse.Validate if the designated constraints aren't met.

func (SetupResponseValidationError) Cause

Cause function returns cause value.

func (SetupResponseValidationError) Error

Error satisfies the builtin error interface

func (SetupResponseValidationError) ErrorName

func (e SetupResponseValidationError) ErrorName() string

ErrorName returns error name.

func (SetupResponseValidationError) Field

Field function returns field value.

func (SetupResponseValidationError) Key

Key function returns key value.

func (SetupResponseValidationError) Reason

Reason function returns reason value.

type SyntheticEvent

type SyntheticEvent struct {
	SrcBinding string                   `protobuf:"bytes,1,opt,name=src_binding,json=srcBinding,proto3" json:"src_binding,omitempty"`
	Type       string                   `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"`
	Data       map[string]*values.Value `` /* 149-byte string literal not displayed */
	OriginalId string                   `protobuf:"bytes,4,opt,name=original_id,json=originalId,proto3" json:"original_id,omitempty"`
	// contains filtered or unexported fields
}

func (*SyntheticEvent) Descriptor deprecated

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

Deprecated: Use SyntheticEvent.ProtoReflect.Descriptor instead.

func (*SyntheticEvent) GetData

func (x *SyntheticEvent) GetData() map[string]*values.Value

func (*SyntheticEvent) GetOriginalId

func (x *SyntheticEvent) GetOriginalId() string

func (*SyntheticEvent) GetSrcBinding

func (x *SyntheticEvent) GetSrcBinding() string

func (*SyntheticEvent) GetType

func (x *SyntheticEvent) GetType() string

func (*SyntheticEvent) ProtoMessage

func (*SyntheticEvent) ProtoMessage()

func (*SyntheticEvent) ProtoReflect

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

func (*SyntheticEvent) Reset

func (x *SyntheticEvent) Reset()

func (*SyntheticEvent) String

func (x *SyntheticEvent) String() string

func (*SyntheticEvent) Validate

func (m *SyntheticEvent) Validate() error

Validate checks the field values on SyntheticEvent with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.

type SyntheticEventValidationError

type SyntheticEventValidationError struct {
	// contains filtered or unexported fields
}

SyntheticEventValidationError is the validation error returned by SyntheticEvent.Validate if the designated constraints aren't met.

func (SyntheticEventValidationError) Cause

Cause function returns cause value.

func (SyntheticEventValidationError) Error

Error satisfies the builtin error interface

func (SyntheticEventValidationError) ErrorName

func (e SyntheticEventValidationError) ErrorName() string

ErrorName returns error name.

func (SyntheticEventValidationError) Field

Field function returns field value.

func (SyntheticEventValidationError) Key

Key function returns key value.

func (SyntheticEventValidationError) Reason

Reason function returns reason value.

type UnimplementedLitterBoxServer

type UnimplementedLitterBoxServer struct {
}

UnimplementedLitterBoxServer must be embedded to have forward compatible implementations.

func (UnimplementedLitterBoxServer) Run

func (UnimplementedLitterBoxServer) Scoop

func (UnimplementedLitterBoxServer) Setup

type UnsafeLitterBoxServer

type UnsafeLitterBoxServer interface {
	// contains filtered or unexported methods
}

UnsafeLitterBoxServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to LitterBoxServer will result in compilation errors.

Jump to

Keyboard shortcuts

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