publisher

package
v0.0.0-...-50354ea Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2025 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Overview

Package publisher is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	Publisher_PushTask_FullMethodName = "/Publisher/PushTask"
)

Variables

View Source
var File_publisher_proto protoreflect.FileDescriptor
View Source
var Publisher_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "Publisher",
	HandlerType: (*PublisherServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "PushTask",
			Handler:    _Publisher_PushTask_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "publisher.proto",
}

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

Functions

func NewPublisherEndpoints

func NewPublisherEndpoints() []*api.Endpoint

func RegisterPublisherGw

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

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

func RegisterPublisherGwClient

func RegisterPublisherGwClient(ctx context.Context, mux *runtime.ServeMux, client PublisherClient) error

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

func RegisterPublisherGwFromEndpoint

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

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

func RegisterPublisherGwServer

func RegisterPublisherGwServer(ctx context.Context, mux *runtime.ServeMux, server PublisherServer) error

RegisterPublisherGwServer registers the http handlers for service Publisher to "mux". UnaryRPC :call PublisherServer 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 RegisterPublisherGwFromEndpoint instead.

func RegisterPublisherHandler

func RegisterPublisherHandler(s server.Server, hdlr PublisherHandler, opts ...server.HandlerOption) error

func RegisterPublisherServer

func RegisterPublisherServer(s grpc.ServiceRegistrar, srv PublisherServer)

Types

type PublisherClient

type PublisherClient interface {
	PushTask(ctx context.Context, in *TaskSpec, opts ...grpc.CallOption) (*empty.Empty, error)
}

PublisherClient is the client API for Publisher 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 NewPublisherClient

func NewPublisherClient(cc grpc.ClientConnInterface) PublisherClient

type PublisherHandler

type PublisherHandler interface {
	PushTask(context.Context, *TaskSpec, *empty.Empty) error
}

type PublisherServer

type PublisherServer interface {
	PushTask(context.Context, *TaskSpec) (*empty.Empty, error)
	// contains filtered or unexported methods
}

PublisherServer is the server API for Publisher service. All implementations must embed UnimplementedPublisherServer for forward compatibility

type PublisherService

type PublisherService interface {
	PushTask(ctx context.Context, in *TaskSpec, opts ...client.CallOption) (*empty.Empty, error)
}

func NewPublisherService

func NewPublisherService(name string, c client.Client) PublisherService

type TaskSpec

type TaskSpec struct {
	Id           string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Name         string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	Loc          string `protobuf:"bytes,3,opt,name=loc,proto3" json:"loc,omitempty"`
	AssignedNode string `protobuf:"bytes,4,opt,name=assigned_node,json=assignedNode,proto3" json:"assigned_node,omitempty"`
	CreationTime int64  `protobuf:"varint,5,opt,name=creation_time,json=creationTime,proto3" json:"creation_time,omitempty"`
	Sumname      string `protobuf:"bytes,6,opt,name=sumname,proto3" json:"sumname,omitempty"`
	Type         string `protobuf:"bytes,7,opt,name=type,proto3" json:"type,omitempty"`
	// contains filtered or unexported fields
}

func (*TaskSpec) Descriptor deprecated

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

Deprecated: Use TaskSpec.ProtoReflect.Descriptor instead.

func (*TaskSpec) GetAssignedNode

func (x *TaskSpec) GetAssignedNode() string

func (*TaskSpec) GetCreationTime

func (x *TaskSpec) GetCreationTime() int64

func (*TaskSpec) GetId

func (x *TaskSpec) GetId() string

func (*TaskSpec) GetLoc

func (x *TaskSpec) GetLoc() string

func (*TaskSpec) GetName

func (x *TaskSpec) GetName() string

func (*TaskSpec) GetSumname

func (x *TaskSpec) GetSumname() string

func (*TaskSpec) GetType

func (x *TaskSpec) GetType() string

func (*TaskSpec) ProtoMessage

func (*TaskSpec) ProtoMessage()

func (*TaskSpec) ProtoReflect

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

func (*TaskSpec) Reset

func (x *TaskSpec) Reset()

func (*TaskSpec) String

func (x *TaskSpec) String() string

type UnimplementedPublisherServer

type UnimplementedPublisherServer struct {
}

UnimplementedPublisherServer must be embedded to have forward compatible implementations.

func (UnimplementedPublisherServer) PushTask

type UnsafePublisherServer

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

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

Jump to

Keyboard shortcuts

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