legacy

package
v0.0.0-...-0490640 Latest Latest
Warning

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

Go to latest
Published: May 16, 2019 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package legacy is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

This section is empty.

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 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 *empty.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.

func NewLegacyDataCollectorClient

func NewLegacyDataCollectorClient(cc *grpc.ClientConn) LegacyDataCollectorClient

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, *empty.Empty) (*StatusResponse, error)
}

LegacyDataCollectorServer is the server API for LegacyDataCollector service.

type LegacyDataCollectorServerMock

type LegacyDataCollectorServerMock struct {
	StatusFunc func(context.Context, *empty.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"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*StatusResponse) Descriptor

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

func (*StatusResponse) GetStatus

func (m *StatusResponse) GetStatus() string

func (*StatusResponse) ProtoMessage

func (*StatusResponse) ProtoMessage()

func (*StatusResponse) Reset

func (m *StatusResponse) Reset()

func (*StatusResponse) String

func (m *StatusResponse) String() string

func (*StatusResponse) XXX_DiscardUnknown

func (m *StatusResponse) XXX_DiscardUnknown()

func (*StatusResponse) XXX_Marshal

func (m *StatusResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*StatusResponse) XXX_Merge

func (dst *StatusResponse) XXX_Merge(src proto.Message)

func (*StatusResponse) XXX_Size

func (m *StatusResponse) XXX_Size() int

func (*StatusResponse) XXX_Unmarshal

func (m *StatusResponse) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

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