Documentation ¶
Overview ¶
Package importer is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Constants
- Variables
- func RegisterImporterHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterImporterHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ImporterClient) error
- func RegisterImporterHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterImporterHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ImporterServer) error
- func RegisterImporterServer(s grpc.ServiceRegistrar, srv ImporterServer)
- type ImportCounter
- func (*ImportCounter) Descriptor() ([]byte, []int)deprecated
- func (x *ImportCounter) GetDelete() uint64
- func (x *ImportCounter) GetError() uint64
- func (x *ImportCounter) GetRecv() uint64
- func (x *ImportCounter) GetSet() uint64
- func (x *ImportCounter) GetType() string
- func (*ImportCounter) ProtoMessage()
- func (x *ImportCounter) ProtoReflect() protoreflect.Message
- func (x *ImportCounter) Reset()
- func (x *ImportCounter) String() string
- type ImportRequest
- func (*ImportRequest) Descriptor() ([]byte, []int)deprecated
- func (m *ImportRequest) GetMsg() isImportRequest_Msg
- func (x *ImportRequest) GetObject() *v3.Object
- func (x *ImportRequest) GetOpCode() Opcode
- func (x *ImportRequest) GetRelation() *v3.Relation
- func (*ImportRequest) ProtoMessage()
- func (x *ImportRequest) ProtoReflect() protoreflect.Message
- func (x *ImportRequest) Reset()
- func (x *ImportRequest) String() string
- type ImportRequest_Object
- type ImportRequest_Relation
- type ImportResponse
- func (*ImportResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ImportResponse) GetCounter() *ImportCounter
- func (m *ImportResponse) GetMsg() isImportResponse_Msg
- func (x *ImportResponse) GetObject() *ImportCounterdeprecated
- func (x *ImportResponse) GetRelation() *ImportCounterdeprecated
- func (x *ImportResponse) GetStatus() *ImportStatus
- func (*ImportResponse) ProtoMessage()
- func (x *ImportResponse) ProtoReflect() protoreflect.Message
- func (x *ImportResponse) Reset()
- func (x *ImportResponse) String() string
- type ImportResponse_Counter
- type ImportResponse_Status
- type ImportStatus
- func (*ImportStatus) Descriptor() ([]byte, []int)deprecated
- func (x *ImportStatus) GetCode() uint32
- func (x *ImportStatus) GetMsg() string
- func (x *ImportStatus) GetReq() *ImportRequest
- func (*ImportStatus) ProtoMessage()
- func (x *ImportStatus) ProtoReflect() protoreflect.Message
- func (x *ImportStatus) Reset()
- func (x *ImportStatus) String() string
- type ImporterClient
- type ImporterServer
- type Importer_ImportClient
- type Importer_ImportServer
- type Opcode
- type UnimplementedImporterServer
- type UnsafeImporterServer
Constants ¶
const (
Importer_Import_FullMethodName = "/aserto.directory.importer.v3.Importer/Import"
)
Variables ¶
var ( Opcode_name = map[int32]string{ 0: "OPCODE_UNKNOWN", 1: "OPCODE_SET", 2: "OPCODE_DELETE", 3: "OPCODE_DELETE_WITH_RELATIONS", } Opcode_value = map[string]int32{ "OPCODE_UNKNOWN": 0, "OPCODE_SET": 1, "OPCODE_DELETE": 2, "OPCODE_DELETE_WITH_RELATIONS": 3, } )
Enum value maps for Opcode.
var File_aserto_directory_importer_v3_importer_proto protoreflect.FileDescriptor
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. 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 ¶
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"` // counter of type (object|relation) Type string `protobuf:"bytes,5,opt,name=type,proto3" json:"type,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) GetType ¶ added in v0.31.8
func (x *ImportCounter) GetType() string
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_Relation ¶
type ImportResponse ¶
type ImportResponse struct { // object import counter // // Deprecated: Marked as deprecated in aserto/directory/importer/v3/importer.proto. Object *ImportCounter `protobuf:"bytes,1,opt,name=object,proto3" json:"object,omitempty"` // relation import counter // // Deprecated: Marked as deprecated in aserto/directory/importer/v3/importer.proto. Relation *ImportCounter `protobuf:"bytes,2,opt,name=relation,proto3" json:"relation,omitempty"` // Types that are assignable to Msg: // // *ImportResponse_Status // *ImportResponse_Counter Msg isImportResponse_Msg `protobuf_oneof:"msg"` // contains filtered or unexported fields }
func (*ImportResponse) Descriptor
deprecated
func (*ImportResponse) Descriptor() ([]byte, []int)
Deprecated: Use ImportResponse.ProtoReflect.Descriptor instead.
func (*ImportResponse) GetCounter ¶ added in v0.31.8
func (x *ImportResponse) GetCounter() *ImportCounter
func (*ImportResponse) GetMsg ¶ added in v0.31.8
func (m *ImportResponse) GetMsg() isImportResponse_Msg
func (*ImportResponse) GetObject
deprecated
func (x *ImportResponse) GetObject() *ImportCounter
Deprecated: Marked as deprecated in aserto/directory/importer/v3/importer.proto.
func (*ImportResponse) GetRelation
deprecated
func (x *ImportResponse) GetRelation() *ImportCounter
Deprecated: Marked as deprecated in aserto/directory/importer/v3/importer.proto.
func (*ImportResponse) GetStatus ¶ added in v0.31.7
func (x *ImportResponse) GetStatus() *ImportStatus
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 ImportResponse_Counter ¶ added in v0.31.8
type ImportResponse_Counter struct { // import counter per type Counter *ImportCounter `protobuf:"bytes,5,opt,name=counter,proto3,oneof"` }
type ImportResponse_Status ¶ added in v0.31.8
type ImportResponse_Status struct { // import status message Status *ImportStatus `protobuf:"bytes,4,opt,name=status,proto3,oneof"` }
type ImportStatus ¶ added in v0.31.7
type ImportStatus struct { // gRPC status code (google.golang.org/grpc/codes) Code uint32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` // gRPC status message (google.golang.org/grpc/status) Msg string `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"` // req contains the original import request message Req *ImportRequest `protobuf:"bytes,3,opt,name=req,proto3" json:"req,omitempty"` // contains filtered or unexported fields }
func (*ImportStatus) Descriptor
deprecated
added in
v0.31.7
func (*ImportStatus) Descriptor() ([]byte, []int)
Deprecated: Use ImportStatus.ProtoReflect.Descriptor instead.
func (*ImportStatus) GetCode ¶ added in v0.31.7
func (x *ImportStatus) GetCode() uint32
func (*ImportStatus) GetMsg ¶ added in v0.31.7
func (x *ImportStatus) GetMsg() string
func (*ImportStatus) GetReq ¶ added in v0.31.7
func (x *ImportStatus) GetReq() *ImportRequest
func (*ImportStatus) ProtoMessage ¶ added in v0.31.7
func (*ImportStatus) ProtoMessage()
func (*ImportStatus) ProtoReflect ¶ added in v0.31.7
func (x *ImportStatus) ProtoReflect() protoreflect.Message
func (*ImportStatus) Reset ¶ added in v0.31.7
func (x *ImportStatus) Reset()
func (*ImportStatus) String ¶ added in v0.31.7
func (x *ImportStatus) String() string
type ImporterClient ¶
type ImporterClient interface { // 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 { // 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 ¶
type Opcode int32
func (Opcode) Descriptor ¶
func (Opcode) Descriptor() protoreflect.EnumDescriptor
func (Opcode) EnumDescriptor
deprecated
func (Opcode) Number ¶
func (x Opcode) Number() protoreflect.EnumNumber
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 ¶
func (UnimplementedImporterServer) Import(grpc.BidiStreamingServer[ImportRequest, ImportResponse]) error
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.