programssvc

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2023 License: MIT Imports: 30 Imported by: 0

Documentation

Overview

Package programssvc is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var File_programssvc_svc_proto protoreflect.FileDescriptor
View Source
var Programs_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "autokitteh.programssvc.Programs",
	HandlerType: (*ProgramsServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Get",
			Handler:    _Programs_Get_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "programssvc/svc.proto",
}

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

Functions

func RegisterProgramsHandler

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

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

func RegisterProgramsHandlerClient

func RegisterProgramsHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ProgramsClient) error

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

func RegisterProgramsHandlerFromEndpoint

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

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

func RegisterProgramsHandlerServer

func RegisterProgramsHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ProgramsServer) error

RegisterProgramsHandlerServer registers the http handlers for service Programs to "mux". UnaryRPC :call ProgramsServer 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 RegisterProgramsHandlerFromEndpoint instead.

func RegisterProgramsServer

func RegisterProgramsServer(s grpc.ServiceRegistrar, srv ProgramsServer)

Types

type GetRequest

type GetRequest struct {
	ProjectId  string        `protobuf:"bytes,1,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"`
	Path       *program.Path `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"`
	RawPath    string        `protobuf:"bytes,3,opt,name=raw_path,json=rawPath,proto3" json:"raw_path,omitempty"`           // if set, overrides path.
	OmitSource bool          `protobuf:"varint,4,opt,name=omit_source,json=omitSource,proto3" json:"omit_source,omitempty"` // if set, source is not returned.
	// contains filtered or unexported fields
}

func (*GetRequest) Descriptor deprecated

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

Deprecated: Use GetRequest.ProtoReflect.Descriptor instead.

func (*GetRequest) GetOmitSource added in v0.10.1

func (x *GetRequest) GetOmitSource() bool

func (*GetRequest) GetPath added in v0.10.1

func (x *GetRequest) GetPath() *program.Path

func (*GetRequest) GetProjectId

func (x *GetRequest) GetProjectId() string

func (*GetRequest) GetRawPath added in v0.10.1

func (x *GetRequest) GetRawPath() string

func (*GetRequest) ProtoMessage

func (*GetRequest) ProtoMessage()

func (*GetRequest) ProtoReflect

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

func (*GetRequest) Reset

func (x *GetRequest) Reset()

func (*GetRequest) String

func (x *GetRequest) String() string

func (*GetRequest) Validate

func (m *GetRequest) Validate() error

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

type GetRequestValidationError

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

GetRequestValidationError is the validation error returned by GetRequest.Validate if the designated constraints aren't met.

func (GetRequestValidationError) Cause

func (e GetRequestValidationError) Cause() error

Cause function returns cause value.

func (GetRequestValidationError) Error

Error satisfies the builtin error interface

func (GetRequestValidationError) ErrorName

func (e GetRequestValidationError) ErrorName() string

ErrorName returns error name.

func (GetRequestValidationError) Field

Field function returns field value.

func (GetRequestValidationError) Key

Key function returns key value.

func (GetRequestValidationError) Reason

func (e GetRequestValidationError) Reason() string

Reason function returns reason value.

type GetResponse

type GetResponse struct {
	Path      *program.Path          `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"`
	Source    []byte                 `protobuf:"bytes,2,opt,name=source,proto3" json:"source,omitempty"`
	FetchedAt *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=fetched_at,json=fetchedAt,proto3" json:"fetched_at,omitempty"`
	// contains filtered or unexported fields
}

func (*GetResponse) Descriptor deprecated

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

Deprecated: Use GetResponse.ProtoReflect.Descriptor instead.

func (*GetResponse) GetFetchedAt added in v0.10.1

func (x *GetResponse) GetFetchedAt() *timestamppb.Timestamp

func (*GetResponse) GetPath added in v0.10.1

func (x *GetResponse) GetPath() *program.Path

func (*GetResponse) GetSource added in v0.10.1

func (x *GetResponse) GetSource() []byte

func (*GetResponse) ProtoMessage

func (*GetResponse) ProtoMessage()

func (*GetResponse) ProtoReflect

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

func (*GetResponse) Reset

func (x *GetResponse) Reset()

func (*GetResponse) String

func (x *GetResponse) String() string

func (*GetResponse) Validate

func (m *GetResponse) Validate() error

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

type GetResponseValidationError

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

GetResponseValidationError is the validation error returned by GetResponse.Validate if the designated constraints aren't met.

func (GetResponseValidationError) Cause

Cause function returns cause value.

func (GetResponseValidationError) Error

Error satisfies the builtin error interface

func (GetResponseValidationError) ErrorName

func (e GetResponseValidationError) ErrorName() string

ErrorName returns error name.

func (GetResponseValidationError) Field

Field function returns field value.

func (GetResponseValidationError) Key

Key function returns key value.

func (GetResponseValidationError) Reason

Reason function returns reason value.

type ProgramsClient

type ProgramsClient interface {
	Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error)
}

ProgramsClient is the client API for Programs 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 NewProgramsClient

func NewProgramsClient(cc grpc.ClientConnInterface) ProgramsClient

type ProgramsServer

type ProgramsServer interface {
	Get(context.Context, *GetRequest) (*GetResponse, error)
	// contains filtered or unexported methods
}

ProgramsServer is the server API for Programs service. All implementations must embed UnimplementedProgramsServer for forward compatibility

type UnimplementedProgramsServer

type UnimplementedProgramsServer struct {
}

UnimplementedProgramsServer must be embedded to have forward compatible implementations.

func (UnimplementedProgramsServer) Get

type UnsafeProgramsServer

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

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

Jump to

Keyboard shortcuts

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