importer

package
v0.31.3 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2024 License: Apache-2.0 Imports: 16 Imported by: 11

Documentation

Overview

Package importer is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	Importer_Import_FullMethodName = "/aserto.directory.importer.v3.Importer/Import"
)

Variables

View Source
var (
	Opcode_name = map[int32]string{
		0: "OPCODE_UNKNOWN",
		1: "OPCODE_SET",
		2: "OPCODE_DELETE",
	}
	Opcode_value = map[string]int32{
		"OPCODE_UNKNOWN": 0,
		"OPCODE_SET":     1,
		"OPCODE_DELETE":  2,
	}
)

Enum value maps for Opcode.

View Source
var File_aserto_directory_importer_v3_importer_proto protoreflect.FileDescriptor
View Source
var Importer_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "aserto.directory.importer.v3.Importer",
	HandlerType: (*ImporterServer)(nil),
	Methods:     []grpc.MethodDesc{},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "Import",
			Handler:       _Importer_Import_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
	},
	Metadata: "aserto/directory/importer/v3/importer.proto",
}

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

Functions

func RegisterImporterHandler

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

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

func RegisterImporterHandlerClient

func RegisterImporterHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ImporterClient) error

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

func RegisterImporterHandlerFromEndpoint

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

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

func RegisterImporterHandlerServer

func RegisterImporterHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ImporterServer) error

RegisterImporterHandlerServer registers the http handlers for service Importer to "mux". UnaryRPC :call ImporterServer 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 RegisterImporterHandlerFromEndpoint instead.

func RegisterImporterServer

func RegisterImporterServer(s grpc.ServiceRegistrar, srv ImporterServer)

Types

type ImportCounter

type ImportCounter struct {

	// number of messages received
	Recv uint64 `protobuf:"varint,1,opt,name=recv,proto3" json:"recv,omitempty"`
	// number of messages with OPCODE_SET
	Set uint64 `protobuf:"varint,2,opt,name=set,proto3" json:"set,omitempty"`
	// number of messages with OPCODE_DELETE
	Delete uint64 `protobuf:"varint,3,opt,name=delete,proto3" json:"delete,omitempty"`
	// number of messages resulting in error
	Error uint64 `protobuf:"varint,4,opt,name=error,proto3" json:"error,omitempty"`
	// contains filtered or unexported fields
}

func (*ImportCounter) Descriptor deprecated

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

Deprecated: Use ImportCounter.ProtoReflect.Descriptor instead.

func (*ImportCounter) GetDelete

func (x *ImportCounter) GetDelete() uint64

func (*ImportCounter) GetError

func (x *ImportCounter) GetError() uint64

func (*ImportCounter) GetRecv

func (x *ImportCounter) GetRecv() uint64

func (*ImportCounter) GetSet

func (x *ImportCounter) GetSet() uint64

func (*ImportCounter) ProtoMessage

func (*ImportCounter) ProtoMessage()

func (*ImportCounter) ProtoReflect

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

func (*ImportCounter) Reset

func (x *ImportCounter) Reset()

func (*ImportCounter) String

func (x *ImportCounter) String() string

type ImportRequest

type ImportRequest struct {

	// operation Opcode enum value
	OpCode Opcode `protobuf:"varint,1,opt,name=op_code,json=opCode,proto3,enum=aserto.directory.importer.v3.Opcode" json:"op_code,omitempty"`
	// Types that are assignable to Msg:
	//
	//	*ImportRequest_Object
	//	*ImportRequest_Relation
	Msg isImportRequest_Msg `protobuf_oneof:"msg"`
	// contains filtered or unexported fields
}

func (*ImportRequest) Descriptor deprecated

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

Deprecated: Use ImportRequest.ProtoReflect.Descriptor instead.

func (*ImportRequest) GetMsg

func (m *ImportRequest) GetMsg() isImportRequest_Msg

func (*ImportRequest) GetObject

func (x *ImportRequest) GetObject() *v3.Object

func (*ImportRequest) GetOpCode

func (x *ImportRequest) GetOpCode() Opcode

func (*ImportRequest) GetRelation

func (x *ImportRequest) GetRelation() *v3.Relation

func (*ImportRequest) ProtoMessage

func (*ImportRequest) ProtoMessage()

func (*ImportRequest) ProtoReflect

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

func (*ImportRequest) Reset

func (x *ImportRequest) Reset()

func (*ImportRequest) String

func (x *ImportRequest) String() string

type ImportRequest_Object

type ImportRequest_Object struct {
	// object import message
	Object *v3.Object `protobuf:"bytes,5,opt,name=object,proto3,oneof"`
}

type ImportRequest_Relation

type ImportRequest_Relation struct {
	// relation import message
	Relation *v3.Relation `protobuf:"bytes,6,opt,name=relation,proto3,oneof"`
}

type ImportResponse

type ImportResponse struct {

	// object import counter
	Object *ImportCounter `protobuf:"bytes,1,opt,name=object,proto3" json:"object,omitempty"`
	// relation import counter
	Relation *ImportCounter `protobuf:"bytes,2,opt,name=relation,proto3" json:"relation,omitempty"`
	// contains filtered or unexported fields
}

func (*ImportResponse) Descriptor deprecated

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

Deprecated: Use ImportResponse.ProtoReflect.Descriptor instead.

func (*ImportResponse) GetObject

func (x *ImportResponse) GetObject() *ImportCounter

func (*ImportResponse) GetRelation

func (x *ImportResponse) GetRelation() *ImportCounter

func (*ImportResponse) ProtoMessage

func (*ImportResponse) ProtoMessage()

func (*ImportResponse) ProtoReflect

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

func (*ImportResponse) Reset

func (x *ImportResponse) Reset()

func (*ImportResponse) String

func (x *ImportResponse) String() string

type ImporterClient

type ImporterClient interface {
	Import(ctx context.Context, opts ...grpc.CallOption) (Importer_ImportClient, error)
}

ImporterClient is the client API for Importer 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 NewImporterClient

func NewImporterClient(cc grpc.ClientConnInterface) ImporterClient

type ImporterServer

type ImporterServer interface {
	Import(Importer_ImportServer) error
}

ImporterServer is the server API for Importer service. All implementations should embed UnimplementedImporterServer for forward compatibility

type Importer_ImportClient

type Importer_ImportClient interface {
	Send(*ImportRequest) error
	Recv() (*ImportResponse, error)
	grpc.ClientStream
}

type Importer_ImportServer

type Importer_ImportServer interface {
	Send(*ImportResponse) error
	Recv() (*ImportRequest, error)
	grpc.ServerStream
}

type Opcode

type Opcode int32
const (
	Opcode_OPCODE_UNKNOWN Opcode = 0
	Opcode_OPCODE_SET     Opcode = 1
	Opcode_OPCODE_DELETE  Opcode = 2
)

func (Opcode) Descriptor

func (Opcode) Descriptor() protoreflect.EnumDescriptor

func (Opcode) Enum

func (x Opcode) Enum() *Opcode

func (Opcode) EnumDescriptor deprecated

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

Deprecated: Use Opcode.Descriptor instead.

func (Opcode) Number

func (x Opcode) Number() protoreflect.EnumNumber

func (Opcode) String

func (x Opcode) String() string

func (Opcode) Type

func (Opcode) Type() protoreflect.EnumType

type UnimplementedImporterServer

type UnimplementedImporterServer struct {
}

UnimplementedImporterServer should be embedded to have forward compatible implementations.

func (UnimplementedImporterServer) Import

type UnsafeImporterServer

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

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

Jump to

Keyboard shortcuts

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