proto

package
v0.0.16-r04 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2022 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Overview

Package proto is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var (
	InstanceStatus_name = map[int32]string{
		0: "UNSPECIFIED",
		1: "INIT",
		2: "MODIFIED",
		3: "UP",
		4: "DOWN",
		5: "DEL",
		6: "SUS",
	}
	InstanceStatus_value = map[string]int32{
		"UNSPECIFIED": 0,
		"INIT":        1,
		"MODIFIED":    2,
		"UP":          3,
		"DOWN":        4,
		"DEL":         5,
		"SUS":         6,
	}
)

Enum value maps for InstanceStatus.

View Source
var File_pkg_instances_proto_instances_proto protoreflect.FileDescriptor
View Source
var InstancesService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "nocloud.instances.InstancesService",
	HandlerType: (*InstancesServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Invoke",
			Handler:    _InstancesService_Invoke_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "pkg/instances/proto/instances.proto",
}

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

Functions

func RegisterInstancesServiceHandler

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

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

func RegisterInstancesServiceHandlerClient

func RegisterInstancesServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client InstancesServiceClient) error

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

func RegisterInstancesServiceHandlerFromEndpoint

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

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

func RegisterInstancesServiceHandlerServer

func RegisterInstancesServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server InstancesServiceServer) error

RegisterInstancesServiceHandlerServer registers the http handlers for service InstancesService to "mux". UnaryRPC :call InstancesServiceServer 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 RegisterInstancesServiceHandlerFromEndpoint instead.

func RegisterInstancesServiceServer

func RegisterInstancesServiceServer(s grpc.ServiceRegistrar, srv InstancesServiceServer)

Types

type Instance

type Instance struct {
	Uuid        string                     `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"`
	Title       string                     `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"`
	Status      InstanceStatus             `protobuf:"varint,3,opt,name=status,proto3,enum=nocloud.instances.InstanceStatus" json:"status,omitempty"`
	Config      map[string]*structpb.Value `` /* 153-byte string literal not displayed */
	Resources   map[string]*structpb.Value `` /* 159-byte string literal not displayed */
	Data        map[string]*structpb.Value `` /* 149-byte string literal not displayed */
	State       *proto.State               `protobuf:"bytes,7,opt,name=state,proto3" json:"state,omitempty"`
	Hash        string                     `protobuf:"bytes,8,opt,name=hash,proto3" json:"hash,omitempty"`
	BillingPlan *proto1.Plan               `protobuf:"bytes,9,opt,name=billing_plan,json=billingPlan,proto3" json:"billing_plan,omitempty"`
	Product     *string                    `protobuf:"bytes,10,opt,name=product,proto3,oneof" json:"product,omitempty"`
	Access      *access.Access             `protobuf:"bytes,11,opt,name=access,proto3,oneof" json:"access,omitempty"`
	// contains filtered or unexported fields
}

func (*Instance) Descriptor deprecated

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

Deprecated: Use Instance.ProtoReflect.Descriptor instead.

func (*Instance) GetAccess

func (x *Instance) GetAccess() *access.Access

func (*Instance) GetBillingPlan

func (x *Instance) GetBillingPlan() *proto1.Plan

func (*Instance) GetConfig

func (x *Instance) GetConfig() map[string]*structpb.Value

func (*Instance) GetData

func (x *Instance) GetData() map[string]*structpb.Value

func (*Instance) GetHash

func (x *Instance) GetHash() string

func (*Instance) GetProduct

func (x *Instance) GetProduct() string

func (*Instance) GetResources

func (x *Instance) GetResources() map[string]*structpb.Value

func (*Instance) GetState

func (x *Instance) GetState() *proto.State

func (*Instance) GetStatus

func (x *Instance) GetStatus() InstanceStatus

func (*Instance) GetTitle

func (x *Instance) GetTitle() string

func (*Instance) GetUuid

func (x *Instance) GetUuid() string

func (*Instance) ProtoMessage

func (*Instance) ProtoMessage()

func (*Instance) ProtoReflect

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

func (*Instance) Reset

func (x *Instance) Reset()

func (*Instance) String

func (x *Instance) String() string

type InstanceStatus

type InstanceStatus int32
const (
	InstanceStatus_UNSPECIFIED InstanceStatus = 0
	InstanceStatus_INIT        InstanceStatus = 1
	InstanceStatus_MODIFIED    InstanceStatus = 2
	InstanceStatus_UP          InstanceStatus = 3
	InstanceStatus_DOWN        InstanceStatus = 4
	InstanceStatus_DEL         InstanceStatus = 5
	InstanceStatus_SUS         InstanceStatus = 6
)

func (InstanceStatus) Descriptor

func (InstanceStatus) Enum

func (x InstanceStatus) Enum() *InstanceStatus

func (InstanceStatus) EnumDescriptor deprecated

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

Deprecated: Use InstanceStatus.Descriptor instead.

func (InstanceStatus) Number

func (InstanceStatus) String

func (x InstanceStatus) String() string

func (InstanceStatus) Type

type InstancesGroup

type InstancesGroup struct {
	Uuid      string                     `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"`
	Type      string                     `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"`
	Title     string                     `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"`
	Status    InstanceStatus             `protobuf:"varint,4,opt,name=status,proto3,enum=nocloud.instances.InstanceStatus" json:"status,omitempty"`
	Config    map[string]*structpb.Value `` /* 153-byte string literal not displayed */
	Instances []*Instance                `protobuf:"bytes,6,rep,name=instances,proto3" json:"instances,omitempty"`
	Resources map[string]*structpb.Value `` /* 159-byte string literal not displayed */
	Data      map[string]*structpb.Value `` /* 149-byte string literal not displayed */
	Hash      string                     `protobuf:"bytes,9,opt,name=hash,proto3" json:"hash,omitempty"`
	Sp        *string                    `protobuf:"bytes,10,opt,name=sp,proto3,oneof" json:"sp,omitempty"`
	Access    *access.Access             `protobuf:"bytes,11,opt,name=access,proto3,oneof" json:"access,omitempty"`
	// contains filtered or unexported fields
}

func (*InstancesGroup) Descriptor deprecated

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

Deprecated: Use InstancesGroup.ProtoReflect.Descriptor instead.

func (*InstancesGroup) GetAccess

func (x *InstancesGroup) GetAccess() *access.Access

func (*InstancesGroup) GetConfig

func (x *InstancesGroup) GetConfig() map[string]*structpb.Value

func (*InstancesGroup) GetData

func (x *InstancesGroup) GetData() map[string]*structpb.Value

func (*InstancesGroup) GetHash

func (x *InstancesGroup) GetHash() string

func (*InstancesGroup) GetInstances

func (x *InstancesGroup) GetInstances() []*Instance

func (*InstancesGroup) GetResources

func (x *InstancesGroup) GetResources() map[string]*structpb.Value

func (*InstancesGroup) GetSp

func (x *InstancesGroup) GetSp() string

func (*InstancesGroup) GetStatus

func (x *InstancesGroup) GetStatus() InstanceStatus

func (*InstancesGroup) GetTitle

func (x *InstancesGroup) GetTitle() string

func (*InstancesGroup) GetType

func (x *InstancesGroup) GetType() string

func (*InstancesGroup) GetUuid

func (x *InstancesGroup) GetUuid() string

func (*InstancesGroup) ProtoMessage

func (*InstancesGroup) ProtoMessage()

func (*InstancesGroup) ProtoReflect

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

func (*InstancesGroup) Reset

func (x *InstancesGroup) Reset()

func (*InstancesGroup) String

func (x *InstancesGroup) String() string

type InstancesServiceClient

type InstancesServiceClient interface {
	Invoke(ctx context.Context, in *InvokeRequest, opts ...grpc.CallOption) (*InvokeResponse, error)
}

InstancesServiceClient is the client API for InstancesService 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 InstancesServiceServer

type InstancesServiceServer interface {
	Invoke(context.Context, *InvokeRequest) (*InvokeResponse, error)
	// contains filtered or unexported methods
}

InstancesServiceServer is the server API for InstancesService service. All implementations must embed UnimplementedInstancesServiceServer for forward compatibility

type InvokeRequest

type InvokeRequest struct {
	Uuid   string                     `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"`
	Method string                     `protobuf:"bytes,2,opt,name=method,proto3" json:"method,omitempty"`
	Params map[string]*structpb.Value `` /* 153-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*InvokeRequest) Descriptor deprecated

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

Deprecated: Use InvokeRequest.ProtoReflect.Descriptor instead.

func (*InvokeRequest) GetMethod

func (x *InvokeRequest) GetMethod() string

func (*InvokeRequest) GetParams

func (x *InvokeRequest) GetParams() map[string]*structpb.Value

func (*InvokeRequest) GetUuid

func (x *InvokeRequest) GetUuid() string

func (*InvokeRequest) ProtoMessage

func (*InvokeRequest) ProtoMessage()

func (*InvokeRequest) ProtoReflect

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

func (*InvokeRequest) Reset

func (x *InvokeRequest) Reset()

func (*InvokeRequest) String

func (x *InvokeRequest) String() string

type InvokeResponse

type InvokeResponse struct {
	Result bool                       `protobuf:"varint,1,opt,name=result,proto3" json:"result,omitempty"`
	Meta   map[string]*structpb.Value `` /* 149-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*InvokeResponse) Descriptor deprecated

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

Deprecated: Use InvokeResponse.ProtoReflect.Descriptor instead.

func (*InvokeResponse) GetMeta

func (x *InvokeResponse) GetMeta() map[string]*structpb.Value

func (*InvokeResponse) GetResult

func (x *InvokeResponse) GetResult() bool

func (*InvokeResponse) ProtoMessage

func (*InvokeResponse) ProtoMessage()

func (*InvokeResponse) ProtoReflect

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

func (*InvokeResponse) Reset

func (x *InvokeResponse) Reset()

func (*InvokeResponse) String

func (x *InvokeResponse) String() string

type ObjectData

type ObjectData struct {
	Uuid string                     `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"`
	Data map[string]*structpb.Value `` /* 149-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*ObjectData) Descriptor deprecated

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

Deprecated: Use ObjectData.ProtoReflect.Descriptor instead.

func (*ObjectData) GetData

func (x *ObjectData) GetData() map[string]*structpb.Value

func (*ObjectData) GetUuid

func (x *ObjectData) GetUuid() string

func (*ObjectData) ProtoMessage

func (*ObjectData) ProtoMessage()

func (*ObjectData) ProtoReflect

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

func (*ObjectData) Reset

func (x *ObjectData) Reset()

func (*ObjectData) String

func (x *ObjectData) String() string

type TestInstancesGroupConfigError

type TestInstancesGroupConfigError struct {
	Error    string `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"`
	Instance string `protobuf:"bytes,2,opt,name=instance,proto3" json:"instance,omitempty"`
	// contains filtered or unexported fields
}

func (*TestInstancesGroupConfigError) Descriptor deprecated

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

Deprecated: Use TestInstancesGroupConfigError.ProtoReflect.Descriptor instead.

func (*TestInstancesGroupConfigError) GetError

func (x *TestInstancesGroupConfigError) GetError() string

func (*TestInstancesGroupConfigError) GetInstance

func (x *TestInstancesGroupConfigError) GetInstance() string

func (*TestInstancesGroupConfigError) ProtoMessage

func (*TestInstancesGroupConfigError) ProtoMessage()

func (*TestInstancesGroupConfigError) ProtoReflect

func (*TestInstancesGroupConfigError) Reset

func (x *TestInstancesGroupConfigError) Reset()

func (*TestInstancesGroupConfigError) String

type TestInstancesGroupConfigRequest

type TestInstancesGroupConfigRequest struct {
	Group *InstancesGroup          `protobuf:"bytes,1,opt,name=group,proto3" json:"group,omitempty"`
	Sp    *proto2.ServicesProvider `protobuf:"bytes,2,opt,name=sp,proto3" json:"sp,omitempty"`
	// contains filtered or unexported fields
}

func (*TestInstancesGroupConfigRequest) Descriptor deprecated

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

Deprecated: Use TestInstancesGroupConfigRequest.ProtoReflect.Descriptor instead.

func (*TestInstancesGroupConfigRequest) GetGroup

func (*TestInstancesGroupConfigRequest) GetSp

func (*TestInstancesGroupConfigRequest) ProtoMessage

func (*TestInstancesGroupConfigRequest) ProtoMessage()

func (*TestInstancesGroupConfigRequest) ProtoReflect

func (*TestInstancesGroupConfigRequest) Reset

func (*TestInstancesGroupConfigRequest) String

type TestInstancesGroupConfigResponse

type TestInstancesGroupConfigResponse struct {
	Result bool                             `protobuf:"varint,1,opt,name=result,proto3" json:"result,omitempty"`
	Errors []*TestInstancesGroupConfigError `protobuf:"bytes,2,rep,name=errors,proto3" json:"errors,omitempty"`
	// contains filtered or unexported fields
}

func (*TestInstancesGroupConfigResponse) Descriptor deprecated

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

Deprecated: Use TestInstancesGroupConfigResponse.ProtoReflect.Descriptor instead.

func (*TestInstancesGroupConfigResponse) GetErrors

func (*TestInstancesGroupConfigResponse) GetResult

func (x *TestInstancesGroupConfigResponse) GetResult() bool

func (*TestInstancesGroupConfigResponse) ProtoMessage

func (*TestInstancesGroupConfigResponse) ProtoMessage()

func (*TestInstancesGroupConfigResponse) ProtoReflect

func (*TestInstancesGroupConfigResponse) Reset

func (*TestInstancesGroupConfigResponse) String

type UnimplementedInstancesServiceServer

type UnimplementedInstancesServiceServer struct {
}

UnimplementedInstancesServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedInstancesServiceServer) Invoke

type UnsafeInstancesServiceServer

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

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

Jump to

Keyboard shortcuts

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