slo

package
v0.0.0-...-c8afd98 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2022 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package slo is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var File_plugins_slo_pkg_slo_proto protoreflect.FileDescriptor
View Source
var OpniSlo_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "slo.OpniSlo",
	HandlerType: (*OpniSloServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetSlo",
			Handler:    _OpniSlo_GetSlo_Handler,
		},
		{
			MethodName: "SetSlo",
			Handler:    _OpniSlo_SetSlo_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "plugins/slo/pkg/slo.proto",
}

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

Functions

func RegisterOpniSloHandler

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

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

func RegisterOpniSloHandlerClient

func RegisterOpniSloHandlerClient(ctx context.Context, mux *runtime.ServeMux, client OpniSloClient) error

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

func RegisterOpniSloHandlerFromEndpoint

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

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

func RegisterOpniSloHandlerServer

func RegisterOpniSloHandlerServer(ctx context.Context, mux *runtime.ServeMux, server OpniSloServer) error

RegisterOpniSloHandlerServer registers the http handlers for service OpniSlo to "mux". UnaryRPC :call OpniSloServer 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 RegisterOpniSloHandlerFromEndpoint instead.

func RegisterOpniSloServer

func RegisterOpniSloServer(s grpc.ServiceRegistrar, srv OpniSloServer)

Types

type CreateSloRequest

type CreateSloRequest struct {
	Name         string  `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Slimetric    string  `protobuf:"bytes,2,opt,name=slimetric,proto3" json:"slimetric,omitempty"`
	Slithreshold string  `protobuf:"bytes,3,opt,name=slithreshold,proto3" json:"slithreshold,omitempty"`
	Slothreshold float32 `protobuf:"fixed32,4,opt,name=slothreshold,proto3" json:"slothreshold,omitempty"`
	// contains filtered or unexported fields
}

func (*CreateSloRequest) Descriptor deprecated

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

Deprecated: Use CreateSloRequest.ProtoReflect.Descriptor instead.

func (*CreateSloRequest) GetName

func (x *CreateSloRequest) GetName() string

func (*CreateSloRequest) GetSlimetric

func (x *CreateSloRequest) GetSlimetric() string

func (*CreateSloRequest) GetSlithreshold

func (x *CreateSloRequest) GetSlithreshold() string

func (*CreateSloRequest) GetSlothreshold

func (x *CreateSloRequest) GetSlothreshold() float32

func (*CreateSloRequest) ProtoMessage

func (*CreateSloRequest) ProtoMessage()

func (*CreateSloRequest) ProtoReflect

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

func (*CreateSloRequest) Reset

func (x *CreateSloRequest) Reset()

func (*CreateSloRequest) String

func (x *CreateSloRequest) String() string

type GetSloRequest

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

func (*GetSloRequest) Descriptor deprecated

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

Deprecated: Use GetSloRequest.ProtoReflect.Descriptor instead.

func (*GetSloRequest) GetMessage

func (x *GetSloRequest) GetMessage() string

func (*GetSloRequest) ProtoMessage

func (*GetSloRequest) ProtoMessage()

func (*GetSloRequest) ProtoReflect

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

func (*GetSloRequest) Reset

func (x *GetSloRequest) Reset()

func (*GetSloRequest) String

func (x *GetSloRequest) String() string

type OpniSloClient

type OpniSloClient interface {
	GetSlo(ctx context.Context, in *GetSloRequest, opts ...grpc.CallOption) (*SloResponse, error)
	SetSlo(ctx context.Context, in *CreateSloRequest, opts ...grpc.CallOption) (*Slo, error)
}

OpniSloClient is the client API for OpniSlo 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 NewOpniSloClient

func NewOpniSloClient(cc grpc.ClientConnInterface) OpniSloClient

type OpniSloServer

type OpniSloServer interface {
	GetSlo(context.Context, *GetSloRequest) (*SloResponse, error)
	SetSlo(context.Context, *CreateSloRequest) (*Slo, error)
	// contains filtered or unexported methods
}

OpniSloServer is the server API for OpniSlo service. All implementations must embed UnimplementedOpniSloServer for forward compatibility

type Slo

type Slo struct {
	Id           int32   `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	Name         string  `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	Slimetric    string  `protobuf:"bytes,3,opt,name=slimetric,proto3" json:"slimetric,omitempty"`
	Slithreshold string  `protobuf:"bytes,4,opt,name=slithreshold,proto3" json:"slithreshold,omitempty"`
	Slothreshold float32 `protobuf:"fixed32,5,opt,name=slothreshold,proto3" json:"slothreshold,omitempty"`
	// contains filtered or unexported fields
}

func (*Slo) Descriptor deprecated

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

Deprecated: Use Slo.ProtoReflect.Descriptor instead.

func (*Slo) GetId

func (x *Slo) GetId() int32

func (*Slo) GetName

func (x *Slo) GetName() string

func (*Slo) GetSlimetric

func (x *Slo) GetSlimetric() string

func (*Slo) GetSlithreshold

func (x *Slo) GetSlithreshold() string

func (*Slo) GetSlothreshold

func (x *Slo) GetSlothreshold() float32

func (*Slo) ProtoMessage

func (*Slo) ProtoMessage()

func (*Slo) ProtoReflect

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

func (*Slo) Reset

func (x *Slo) Reset()

func (*Slo) String

func (x *Slo) String() string

type SloPlugin

type SloPlugin struct {
	UnimplementedOpniSloServer
}

func (*SloPlugin) GetSlo

func (s *SloPlugin) GetSlo(_ context.Context, req *GetSloRequest) (*SloResponse, error)

func (*SloPlugin) SetSlo

func (s *SloPlugin) SetSlo(_ context.Context, req *CreateSloRequest) (*Slo, error)

func (*SloPlugin) UseManagementAPI

func (s *SloPlugin) UseManagementAPI(api management.ManagementClient)

type SloResponse

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

func (*SloResponse) Descriptor deprecated

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

Deprecated: Use SloResponse.ProtoReflect.Descriptor instead.

func (*SloResponse) GetMessage

func (x *SloResponse) GetMessage() string

func (*SloResponse) GetStatus

func (x *SloResponse) GetStatus() string

func (*SloResponse) ProtoMessage

func (*SloResponse) ProtoMessage()

func (*SloResponse) ProtoReflect

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

func (*SloResponse) Reset

func (x *SloResponse) Reset()

func (*SloResponse) String

func (x *SloResponse) String() string

type UnimplementedOpniSloServer

type UnimplementedOpniSloServer struct {
}

UnimplementedOpniSloServer must be embedded to have forward compatible implementations.

func (UnimplementedOpniSloServer) GetSlo

func (UnimplementedOpniSloServer) SetSlo

type UnsafeOpniSloServer

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

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

Jump to

Keyboard shortcuts

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