representation

package
v0.6.1-rc1 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2022 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Package representation is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var (
	GraphRepr_name = map[int32]string{
		0: "None",
		1: "KubectlGraph",
	}
	GraphRepr_value = map[string]int32{
		"None":         0,
		"KubectlGraph": 1,
	}
)

Enum value maps for GraphRepr.

View Source
var File_github_com_rancher_opni_pkg_plugins_topology_pkg_apis_representation_representation_proto protoreflect.FileDescriptor
View Source
var TopologyRepresentation_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "representation.TopologyRepresentation",
	HandlerType: (*TopologyRepresentationServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetGraph",
			Handler:    _TopologyRepresentation_GetGraph_Handler,
		},
		{
			MethodName: "RenderGraph",
			Handler:    _TopologyRepresentation_RenderGraph_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "github.com/rancher/opni/pkg/plugins/topology/pkg/apis/representation/representation.proto",
}

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

Functions

func RegisterTopologyRepresentationHandler

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

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

func RegisterTopologyRepresentationHandlerClient

func RegisterTopologyRepresentationHandlerClient(ctx context.Context, mux *runtime.ServeMux, client TopologyRepresentationClient) error

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

func RegisterTopologyRepresentationHandlerFromEndpoint

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

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

func RegisterTopologyRepresentationHandlerServer

func RegisterTopologyRepresentationHandlerServer(ctx context.Context, mux *runtime.ServeMux, server TopologyRepresentationServer) error

RegisterTopologyRepresentationHandlerServer registers the http handlers for service TopologyRepresentation to "mux". UnaryRPC :call TopologyRepresentationServer 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 RegisterTopologyRepresentationHandlerFromEndpoint instead.

func RegisterTopologyRepresentationServer

func RegisterTopologyRepresentationServer(s grpc.ServiceRegistrar, srv TopologyRepresentationServer)

Types

type DOTRepresentation

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

func (*DOTRepresentation) Descriptor deprecated

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

Deprecated: Use DOTRepresentation.ProtoReflect.Descriptor instead.

func (*DOTRepresentation) GetRawDotFormat

func (x *DOTRepresentation) GetRawDotFormat() string

func (*DOTRepresentation) ProtoMessage

func (*DOTRepresentation) ProtoMessage()

func (*DOTRepresentation) ProtoReflect

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

func (*DOTRepresentation) Reset

func (x *DOTRepresentation) Reset()

func (*DOTRepresentation) String

func (x *DOTRepresentation) String() string

type GraphRepr

type GraphRepr int32
const (
	GraphRepr_None         GraphRepr = 0
	GraphRepr_KubectlGraph GraphRepr = 1
)

func (GraphRepr) Descriptor

func (GraphRepr) Descriptor() protoreflect.EnumDescriptor

func (GraphRepr) Enum

func (x GraphRepr) Enum() *GraphRepr

func (GraphRepr) EnumDescriptor deprecated

func (GraphRepr) EnumDescriptor() ([]byte, []int)

Deprecated: Use GraphRepr.Descriptor instead.

func (GraphRepr) Number

func (x GraphRepr) Number() protoreflect.EnumNumber

func (GraphRepr) String

func (x GraphRepr) String() string

func (GraphRepr) Type

type TopologyGraph

type TopologyGraph struct {
	Id   *v1.Reference `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Data []byte        `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
	Repr GraphRepr     `protobuf:"varint,3,opt,name=repr,proto3,enum=representation.GraphRepr" json:"repr,omitempty"`
	// contains filtered or unexported fields
}

func (*TopologyGraph) Descriptor deprecated

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

Deprecated: Use TopologyGraph.ProtoReflect.Descriptor instead.

func (*TopologyGraph) GetData

func (x *TopologyGraph) GetData() []byte

func (*TopologyGraph) GetId

func (x *TopologyGraph) GetId() *v1.Reference

func (*TopologyGraph) GetRepr

func (x *TopologyGraph) GetRepr() GraphRepr

func (*TopologyGraph) ProtoMessage

func (*TopologyGraph) ProtoMessage()

func (*TopologyGraph) ProtoReflect

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

func (*TopologyGraph) Reset

func (x *TopologyGraph) Reset()

func (*TopologyGraph) String

func (x *TopologyGraph) String() string

type TopologyRepresentationClient

type TopologyRepresentationClient interface {
	// opni internal use
	GetGraph(ctx context.Context, in *v1.Reference, opts ...grpc.CallOption) (*TopologyGraph, error)
	// cluster id  --> kubernetes graph SVG
	RenderGraph(ctx context.Context, in *v1.Reference, opts ...grpc.CallOption) (*DOTRepresentation, error)
}

TopologyRepresentationClient is the client API for TopologyRepresentation 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.

type TopologyRepresentationServer

type TopologyRepresentationServer interface {
	// opni internal use
	GetGraph(context.Context, *v1.Reference) (*TopologyGraph, error)
	// cluster id  --> kubernetes graph SVG
	RenderGraph(context.Context, *v1.Reference) (*DOTRepresentation, error)
	// contains filtered or unexported methods
}

TopologyRepresentationServer is the server API for TopologyRepresentation service. All implementations must embed UnimplementedTopologyRepresentationServer for forward compatibility

type UnimplementedTopologyRepresentationServer

type UnimplementedTopologyRepresentationServer struct {
}

UnimplementedTopologyRepresentationServer must be embedded to have forward compatible implementations.

func (UnimplementedTopologyRepresentationServer) GetGraph

func (UnimplementedTopologyRepresentationServer) RenderGraph

type UnsafeTopologyRepresentationServer

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

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

Jump to

Keyboard shortcuts

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