legacy

package
v0.0.0-...-66c7a0d Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2024 License: Apache-2.0 Imports: 19 Imported by: 2

Documentation

Overview

Package legacy is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var File_automate_gateway_api_legacy_legacy_proto protoreflect.FileDescriptor

Functions

func RegisterLegacyDataCollectorHandler

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

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

func RegisterLegacyDataCollectorHandlerClient

func RegisterLegacyDataCollectorHandlerClient(ctx context.Context, mux *runtime.ServeMux, client LegacyDataCollectorClient) error

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

func RegisterLegacyDataCollectorHandlerFromEndpoint

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

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

func RegisterLegacyDataCollectorHandlerServer

func RegisterLegacyDataCollectorHandlerServer(ctx context.Context, mux *runtime.ServeMux, server LegacyDataCollectorServer) error

RegisterLegacyDataCollectorHandlerServer registers the http handlers for service LegacyDataCollector to "mux". UnaryRPC :call LegacyDataCollectorServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.

func RegisterLegacyDataCollectorServer

func RegisterLegacyDataCollectorServer(s *grpc.Server, srv LegacyDataCollectorServer)

Types

type LegacyDataCollectorClient

type LegacyDataCollectorClient interface {
	// This is used by chef-server, it requests a GET /data-collector/v0 to check
	// Automate's status.
	// We proxy /data-collector/v0 to /api/v0/events/data-collector, so this is
	// where we need to respond.
	// Since this is for legacy-support only, we don't bother much about having
	// google.protobuf.Empty as argument.
	Status(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*StatusResponse, error)
}

LegacyDataCollectorClient is the client API for LegacyDataCollector service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

type LegacyDataCollectorServer

type LegacyDataCollectorServer interface {
	// This is used by chef-server, it requests a GET /data-collector/v0 to check
	// Automate's status.
	// We proxy /data-collector/v0 to /api/v0/events/data-collector, so this is
	// where we need to respond.
	// Since this is for legacy-support only, we don't bother much about having
	// google.protobuf.Empty as argument.
	Status(context.Context, *emptypb.Empty) (*StatusResponse, error)
}

LegacyDataCollectorServer is the server API for LegacyDataCollector service.

type LegacyDataCollectorServerMock

type LegacyDataCollectorServerMock struct {
	StatusFunc func(context.Context, *emptypb.Empty) (*StatusResponse, error)
	// contains filtered or unexported fields
}

LegacyDataCollectorServerMock is the mock-what-you-want struct that stubs all not-overridden methods with "not implemented" returns

func NewLegacyDataCollectorServerMock

func NewLegacyDataCollectorServerMock() *LegacyDataCollectorServerMock

NewLegacyDataCollectorServerMock gives you a fresh instance of LegacyDataCollectorServerMock.

func NewLegacyDataCollectorServerMockWithoutValidation

func NewLegacyDataCollectorServerMockWithoutValidation() *LegacyDataCollectorServerMock

NewLegacyDataCollectorServerMockWithoutValidation gives you a fresh instance of LegacyDataCollectorServerMock which does not attempt to validate requests before passing them to their respective '*Func'.

func (*LegacyDataCollectorServerMock) Reset

func (m *LegacyDataCollectorServerMock) Reset()

Reset resets all overridden functions

func (*LegacyDataCollectorServerMock) Status

type StatusResponse

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

func (*StatusResponse) Descriptor deprecated

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

Deprecated: Use StatusResponse.ProtoReflect.Descriptor instead.

func (*StatusResponse) GetStatus

func (x *StatusResponse) GetStatus() string

func (*StatusResponse) ProtoMessage

func (*StatusResponse) ProtoMessage()

func (*StatusResponse) ProtoReflect

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

func (*StatusResponse) Reset

func (x *StatusResponse) Reset()

func (*StatusResponse) String

func (x *StatusResponse) String() string

type UnimplementedLegacyDataCollectorServer

type UnimplementedLegacyDataCollectorServer struct {
}

UnimplementedLegacyDataCollectorServer can be embedded to have forward compatible implementations.

func (*UnimplementedLegacyDataCollectorServer) Status

Jump to

Keyboard shortcuts

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