rest

package
v1.3.97 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package rest is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	Record_Create_FullMethodName = "/rest.Record/Create"
	Record_Update_FullMethodName = "/rest.Record/Update"
	Record_Apply_FullMethodName  = "/rest.Record/Apply"
	Record_Delete_FullMethodName = "/rest.Record/Delete_"
)

Variables

View Source
var File_stub_rest_record_proto protoreflect.FileDescriptor
View Source
var Record_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "rest.Record",
	HandlerType: (*RecordServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Create",
			Handler:    _Record_Create_Handler,
		},
		{
			MethodName: "Update",
			Handler:    _Record_Update_Handler,
		},
		{
			MethodName: "Apply",
			Handler:    _Record_Apply_Handler,
		},
		{
			MethodName: "Delete_",
			Handler:    _Record_Delete_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "stub/rest/record.proto",
}

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

Functions

func RegisterRecordHandler

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

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

func RegisterRecordHandlerClient

func RegisterRecordHandlerClient(ctx context.Context, mux *runtime.ServeMux, client RecordClient) error

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

func RegisterRecordHandlerFromEndpoint

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

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

func RegisterRecordHandlerServer

func RegisterRecordHandlerServer(ctx context.Context, mux *runtime.ServeMux, server RecordServer) error

RegisterRecordHandlerServer registers the http handlers for service Record to "mux". UnaryRPC :call RecordServer 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 RegisterRecordHandlerFromEndpoint instead.

func RegisterRecordServer

func RegisterRecordServer(s grpc.ServiceRegistrar, srv RecordServer)

Types

type ApplyRecordRequest

type ApplyRecordRequest struct {
	Token        string                     `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"`
	Namespace    string                     `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"`
	Resource     string                     `protobuf:"bytes,3,opt,name=resource,proto3" json:"resource,omitempty"`
	Id           string                     `protobuf:"bytes,4,opt,name=id,proto3" json:"id,omitempty"` // id; read only
	Properties   map[string]*structpb.Value ``                                                          /* 161-byte string literal not displayed */
	CheckVersion bool                       `protobuf:"varint,6,opt,name=checkVersion,proto3" json:"checkVersion,omitempty"`
	Annotations  map[string]string          `` /* 165-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*ApplyRecordRequest) Descriptor deprecated

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

Deprecated: Use ApplyRecordRequest.ProtoReflect.Descriptor instead.

func (*ApplyRecordRequest) GetAnnotations

func (x *ApplyRecordRequest) GetAnnotations() map[string]string

func (*ApplyRecordRequest) GetCheckVersion

func (x *ApplyRecordRequest) GetCheckVersion() bool

func (*ApplyRecordRequest) GetId

func (x *ApplyRecordRequest) GetId() string

func (*ApplyRecordRequest) GetNamespace

func (x *ApplyRecordRequest) GetNamespace() string

func (*ApplyRecordRequest) GetProperties

func (x *ApplyRecordRequest) GetProperties() map[string]*structpb.Value

func (*ApplyRecordRequest) GetResource

func (x *ApplyRecordRequest) GetResource() string

func (*ApplyRecordRequest) GetToken

func (x *ApplyRecordRequest) GetToken() string

func (*ApplyRecordRequest) ProtoMessage

func (*ApplyRecordRequest) ProtoMessage()

func (*ApplyRecordRequest) ProtoReflect

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

func (*ApplyRecordRequest) Reset

func (x *ApplyRecordRequest) Reset()

func (*ApplyRecordRequest) String

func (x *ApplyRecordRequest) String() string

type ApplyRecordResponse

type ApplyRecordResponse struct {
	Properties map[string]*structpb.Value `` /* 161-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*ApplyRecordResponse) Descriptor deprecated

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

Deprecated: Use ApplyRecordResponse.ProtoReflect.Descriptor instead.

func (*ApplyRecordResponse) GetProperties

func (x *ApplyRecordResponse) GetProperties() map[string]*structpb.Value

func (*ApplyRecordResponse) ProtoMessage

func (*ApplyRecordResponse) ProtoMessage()

func (*ApplyRecordResponse) ProtoReflect

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

func (*ApplyRecordResponse) Reset

func (x *ApplyRecordResponse) Reset()

func (*ApplyRecordResponse) String

func (x *ApplyRecordResponse) String() string

type CreateRecordRequest

type CreateRecordRequest struct {
	Token       string                     `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"`
	Namespace   string                     `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"`
	Resource    string                     `protobuf:"bytes,3,opt,name=resource,proto3" json:"resource,omitempty"`
	Properties  map[string]*structpb.Value `` /* 161-byte string literal not displayed */
	Annotations map[string]string          `` /* 165-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*CreateRecordRequest) Descriptor deprecated

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

Deprecated: Use CreateRecordRequest.ProtoReflect.Descriptor instead.

func (*CreateRecordRequest) GetAnnotations

func (x *CreateRecordRequest) GetAnnotations() map[string]string

func (*CreateRecordRequest) GetNamespace

func (x *CreateRecordRequest) GetNamespace() string

func (*CreateRecordRequest) GetProperties

func (x *CreateRecordRequest) GetProperties() map[string]*structpb.Value

func (*CreateRecordRequest) GetResource

func (x *CreateRecordRequest) GetResource() string

func (*CreateRecordRequest) GetToken

func (x *CreateRecordRequest) GetToken() string

func (*CreateRecordRequest) ProtoMessage

func (*CreateRecordRequest) ProtoMessage()

func (*CreateRecordRequest) ProtoReflect

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

func (*CreateRecordRequest) Reset

func (x *CreateRecordRequest) Reset()

func (*CreateRecordRequest) String

func (x *CreateRecordRequest) String() string

type CreateRecordResponse

type CreateRecordResponse struct {
	Id         string                     `protobuf:"bytes,4,opt,name=id,proto3" json:"id,omitempty"` // id; read only
	Properties map[string]*structpb.Value ``                                                          /* 161-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*CreateRecordResponse) Descriptor deprecated

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

Deprecated: Use CreateRecordResponse.ProtoReflect.Descriptor instead.

func (*CreateRecordResponse) GetId

func (x *CreateRecordResponse) GetId() string

func (*CreateRecordResponse) GetProperties

func (x *CreateRecordResponse) GetProperties() map[string]*structpb.Value

func (*CreateRecordResponse) ProtoMessage

func (*CreateRecordResponse) ProtoMessage()

func (*CreateRecordResponse) ProtoReflect

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

func (*CreateRecordResponse) Reset

func (x *CreateRecordResponse) Reset()

func (*CreateRecordResponse) String

func (x *CreateRecordResponse) String() string

type DeleteRecordRequest

type DeleteRecordRequest struct {
	Token       string            `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"`
	Namespace   string            `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"`
	Resource    string            `protobuf:"bytes,3,opt,name=resource,proto3" json:"resource,omitempty"`
	Id          string            `protobuf:"bytes,4,opt,name=id,proto3" json:"id,omitempty"` // Rest Only
	Annotations map[string]string ``                                                          /* 165-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*DeleteRecordRequest) Descriptor deprecated

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

Deprecated: Use DeleteRecordRequest.ProtoReflect.Descriptor instead.

func (*DeleteRecordRequest) GetAnnotations

func (x *DeleteRecordRequest) GetAnnotations() map[string]string

func (*DeleteRecordRequest) GetId

func (x *DeleteRecordRequest) GetId() string

func (*DeleteRecordRequest) GetNamespace

func (x *DeleteRecordRequest) GetNamespace() string

func (*DeleteRecordRequest) GetResource

func (x *DeleteRecordRequest) GetResource() string

func (*DeleteRecordRequest) GetToken

func (x *DeleteRecordRequest) GetToken() string

func (*DeleteRecordRequest) ProtoMessage

func (*DeleteRecordRequest) ProtoMessage()

func (*DeleteRecordRequest) ProtoReflect

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

func (*DeleteRecordRequest) Reset

func (x *DeleteRecordRequest) Reset()

func (*DeleteRecordRequest) String

func (x *DeleteRecordRequest) String() string

type DeleteRecordResponse

type DeleteRecordResponse struct {
	// contains filtered or unexported fields
}

func (*DeleteRecordResponse) Descriptor deprecated

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

Deprecated: Use DeleteRecordResponse.ProtoReflect.Descriptor instead.

func (*DeleteRecordResponse) ProtoMessage

func (*DeleteRecordResponse) ProtoMessage()

func (*DeleteRecordResponse) ProtoReflect

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

func (*DeleteRecordResponse) Reset

func (x *DeleteRecordResponse) Reset()

func (*DeleteRecordResponse) String

func (x *DeleteRecordResponse) String() string

type RecordClient

RecordClient is the client API for Record 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 NewRecordClient

func NewRecordClient(cc grpc.ClientConnInterface) RecordClient

type RecordServer

RecordServer is the server API for Record service. All implementations must embed UnimplementedRecordServer for forward compatibility

type UnimplementedRecordServer

type UnimplementedRecordServer struct {
}

UnimplementedRecordServer must be embedded to have forward compatible implementations.

func (UnimplementedRecordServer) Apply

func (UnimplementedRecordServer) Create

func (UnimplementedRecordServer) Delete

func (UnimplementedRecordServer) Update

type UnsafeRecordServer

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

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

type UpdateRecordRequest

type UpdateRecordRequest struct {
	Token        string                     `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"`
	Namespace    string                     `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"`
	Resource     string                     `protobuf:"bytes,3,opt,name=resource,proto3" json:"resource,omitempty"`
	Id           string                     `protobuf:"bytes,4,opt,name=id,proto3" json:"id,omitempty"` // id; read only
	Properties   map[string]*structpb.Value ``                                                          /* 161-byte string literal not displayed */
	CheckVersion bool                       `protobuf:"varint,6,opt,name=checkVersion,proto3" json:"checkVersion,omitempty"`
	Annotations  map[string]string          `` /* 165-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*UpdateRecordRequest) Descriptor deprecated

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

Deprecated: Use UpdateRecordRequest.ProtoReflect.Descriptor instead.

func (*UpdateRecordRequest) GetAnnotations

func (x *UpdateRecordRequest) GetAnnotations() map[string]string

func (*UpdateRecordRequest) GetCheckVersion

func (x *UpdateRecordRequest) GetCheckVersion() bool

func (*UpdateRecordRequest) GetId

func (x *UpdateRecordRequest) GetId() string

func (*UpdateRecordRequest) GetNamespace

func (x *UpdateRecordRequest) GetNamespace() string

func (*UpdateRecordRequest) GetProperties

func (x *UpdateRecordRequest) GetProperties() map[string]*structpb.Value

func (*UpdateRecordRequest) GetResource

func (x *UpdateRecordRequest) GetResource() string

func (*UpdateRecordRequest) GetToken

func (x *UpdateRecordRequest) GetToken() string

func (*UpdateRecordRequest) ProtoMessage

func (*UpdateRecordRequest) ProtoMessage()

func (*UpdateRecordRequest) ProtoReflect

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

func (*UpdateRecordRequest) Reset

func (x *UpdateRecordRequest) Reset()

func (*UpdateRecordRequest) String

func (x *UpdateRecordRequest) String() string

type UpdateRecordResponse

type UpdateRecordResponse struct {
	Properties map[string]*structpb.Value `` /* 161-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*UpdateRecordResponse) Descriptor deprecated

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

Deprecated: Use UpdateRecordResponse.ProtoReflect.Descriptor instead.

func (*UpdateRecordResponse) GetProperties

func (x *UpdateRecordResponse) GetProperties() map[string]*structpb.Value

func (*UpdateRecordResponse) ProtoMessage

func (*UpdateRecordResponse) ProtoMessage()

func (*UpdateRecordResponse) ProtoReflect

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

func (*UpdateRecordResponse) Reset

func (x *UpdateRecordResponse) Reset()

func (*UpdateRecordResponse) String

func (x *UpdateRecordResponse) String() string

Jump to

Keyboard shortcuts

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