importer

package
v0.31.13 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

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.v2.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_v2_importer_proto protoreflect.FileDescriptor
View Source
var Importer_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "aserto.directory.importer.v2.Importer",
	HandlerType: (*ImporterServer)(nil),
	Methods:     []grpc.MethodDesc{},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "Import",
			Handler:       _Importer_Import_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
	},
	Metadata: "aserto/directory/importer/v2/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. This client ignores the HTTP middlewares.

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. GRPC interceptors will not work for this type of registration. To use interceptors, you must use the "runtime.WithMiddlewares" option in the "runtime.NewServeMux" call.

func RegisterImporterServer

func RegisterImporterServer(s grpc.ServiceRegistrar, srv ImporterServer)

Types

type ImportCounter deprecated

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
}

Deprecated: Marked as deprecated in aserto/directory/importer/v2/importer.proto.

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 deprecated

type ImportRequest struct {

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

Deprecated: Marked as deprecated in aserto/directory/importer/v2/importer.proto.

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() *v2.Object

func (*ImportRequest) GetObjectType

func (x *ImportRequest) GetObjectType() *v2.ObjectType

func (*ImportRequest) GetOpCode

func (x *ImportRequest) GetOpCode() Opcode

func (*ImportRequest) GetPermission

func (x *ImportRequest) GetPermission() *v2.Permission

func (*ImportRequest) GetRelation

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

func (*ImportRequest) GetRelationType

func (x *ImportRequest) GetRelationType() *v2.RelationType

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 *v2.Object `protobuf:"bytes,5,opt,name=object,proto3,oneof"`
}

type ImportRequest_ObjectType

type ImportRequest_ObjectType struct {
	// object_type import message
	ObjectType *v2.ObjectType `protobuf:"bytes,2,opt,name=object_type,json=objectType,proto3,oneof"`
}

type ImportRequest_Permission

type ImportRequest_Permission struct {
	// permission import message
	Permission *v2.Permission `protobuf:"bytes,3,opt,name=permission,proto3,oneof"`
}

type ImportRequest_Relation

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

type ImportRequest_RelationType

type ImportRequest_RelationType struct {
	// relation_type import message
	RelationType *v2.RelationType `protobuf:"bytes,4,opt,name=relation_type,json=relationType,proto3,oneof"`
}

type ImportResponse deprecated

type ImportResponse struct {

	// object_type import counter
	ObjectType *ImportCounter `protobuf:"bytes,1,opt,name=object_type,json=objectType,proto3" json:"object_type,omitempty"`
	// object_type import counter
	Permission *ImportCounter `protobuf:"bytes,2,opt,name=permission,proto3" json:"permission,omitempty"`
	// object_type import counter
	RelationType *ImportCounter `protobuf:"bytes,3,opt,name=relation_type,json=relationType,proto3" json:"relation_type,omitempty"`
	// object import counter
	Object *ImportCounter `protobuf:"bytes,4,opt,name=object,proto3" json:"object,omitempty"`
	// object_type import counter
	Relation *ImportCounter `protobuf:"bytes,5,opt,name=relation,proto3" json:"relation,omitempty"`
	// contains filtered or unexported fields
}

Deprecated: Marked as deprecated in aserto/directory/importer/v2/importer.proto.

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) GetObjectType

func (x *ImportResponse) GetObjectType() *ImportCounter

func (*ImportResponse) GetPermission

func (x *ImportResponse) GetPermission() *ImportCounter

func (*ImportResponse) GetRelation

func (x *ImportResponse) GetRelation() *ImportCounter

func (*ImportResponse) GetRelationType

func (x *ImportResponse) GetRelationType() *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 {
	// Deprecated: Do not use.
	// import stream of objects and relations
	Import(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[ImportRequest, ImportResponse], 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 {
	// Deprecated: Do not use.
	// import stream of objects and relations
	Import(grpc.BidiStreamingServer[ImportRequest, ImportResponse]) error
}

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

type Importer_ImportClient

type Importer_ImportClient = grpc.BidiStreamingClient[ImportRequest, ImportResponse]

This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.

type Importer_ImportServer

type Importer_ImportServer = grpc.BidiStreamingServer[ImportRequest, ImportResponse]

This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.

type Opcode deprecated

type Opcode int32

Deprecated: Marked as deprecated in aserto/directory/importer/v2/importer.proto.

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.

NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.

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