exporter

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: 17 Imported by: 7

Documentation

Overview

Package exporter is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	Exporter_Export_FullMethodName = "/aserto.directory.exporter.v2.Exporter/Export"
)

Variables

View Source
var (
	Option_name = map[int32]string{
		0:  "OPTION_UNKNOWN",
		1:  "OPTION_METADATA_OBJECT_TYPES",
		2:  "OPTION_METADATA_RELATION_TYPES",
		4:  "OPTION_METADATA_PERMISSIONS",
		7:  "OPTION_METADATA",
		8:  "OPTION_DATA_OBJECTS",
		16: "OPTION_DATA_RELATIONS",
		32: "OPTION_DATA_RELATIONS_WITH_KEYS",
		24: "OPTION_DATA",
		40: "OPTION_DATA_WITH_KEYS",
		31: "OPTION_ALL",
		47: "OPTION_ALL_WITH_KEYS",
	}
	Option_value = map[string]int32{
		"OPTION_UNKNOWN":                  0,
		"OPTION_METADATA_OBJECT_TYPES":    1,
		"OPTION_METADATA_RELATION_TYPES":  2,
		"OPTION_METADATA_PERMISSIONS":     4,
		"OPTION_METADATA":                 7,
		"OPTION_DATA_OBJECTS":             8,
		"OPTION_DATA_RELATIONS":           16,
		"OPTION_DATA_RELATIONS_WITH_KEYS": 32,
		"OPTION_DATA":                     24,
		"OPTION_DATA_WITH_KEYS":           40,
		"OPTION_ALL":                      31,
		"OPTION_ALL_WITH_KEYS":            47,
	}
)

Enum value maps for Option.

View Source
var Exporter_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "aserto.directory.exporter.v2.Exporter",
	HandlerType: (*ExporterServer)(nil),
	Methods:     []grpc.MethodDesc{},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "Export",
			Handler:       _Exporter_Export_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "aserto/directory/exporter/v2/exporter.proto",
}

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

View Source
var File_aserto_directory_exporter_v2_exporter_proto protoreflect.FileDescriptor

Functions

func RegisterExporterHandler

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

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

func RegisterExporterHandlerClient

func RegisterExporterHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ExporterClient) error

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

func RegisterExporterHandlerFromEndpoint

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

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

func RegisterExporterHandlerServer

func RegisterExporterHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ExporterServer) error

RegisterExporterHandlerServer registers the http handlers for service Exporter to "mux". UnaryRPC :call ExporterServer 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 RegisterExporterHandlerFromEndpoint instead.

func RegisterExporterServer

func RegisterExporterServer(s grpc.ServiceRegistrar, srv ExporterServer)

Types

type ExportRequest

type ExportRequest struct {

	// data export options mask
	Options uint32 `protobuf:"varint,1,opt,name=options,proto3" json:"options,omitempty"`
	// start export from timestamp (UTC)
	StartFrom *timestamppb.Timestamp `protobuf:"bytes,20,opt,name=start_from,json=startFrom,proto3" json:"start_from,omitempty"`
	// contains filtered or unexported fields
}

func (*ExportRequest) Descriptor deprecated

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

Deprecated: Use ExportRequest.ProtoReflect.Descriptor instead.

func (*ExportRequest) GetOptions

func (x *ExportRequest) GetOptions() uint32

func (*ExportRequest) GetStartFrom

func (x *ExportRequest) GetStartFrom() *timestamppb.Timestamp

func (*ExportRequest) ProtoMessage

func (*ExportRequest) ProtoMessage()

func (*ExportRequest) ProtoReflect

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

func (*ExportRequest) Reset

func (x *ExportRequest) Reset()

func (*ExportRequest) String

func (x *ExportRequest) String() string

type ExportResponse

type ExportResponse struct {

	// Types that are assignable to Msg:
	//
	//	*ExportResponse_Object
	//	*ExportResponse_ObjectType
	//	*ExportResponse_Relation
	//	*ExportResponse_RelationType
	//	*ExportResponse_Permission
	Msg isExportResponse_Msg `protobuf_oneof:"msg"`
	// contains filtered or unexported fields
}

func (*ExportResponse) Descriptor deprecated

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

Deprecated: Use ExportResponse.ProtoReflect.Descriptor instead.

func (*ExportResponse) GetMsg

func (m *ExportResponse) GetMsg() isExportResponse_Msg

func (*ExportResponse) GetObject

func (x *ExportResponse) GetObject() *v2.Object

func (*ExportResponse) GetObjectType

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

func (*ExportResponse) GetPermission

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

func (*ExportResponse) GetRelation

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

func (*ExportResponse) GetRelationType

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

func (*ExportResponse) ProtoMessage

func (*ExportResponse) ProtoMessage()

func (*ExportResponse) ProtoReflect

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

func (*ExportResponse) Reset

func (x *ExportResponse) Reset()

func (*ExportResponse) String

func (x *ExportResponse) String() string

type ExportResponse_Object

type ExportResponse_Object struct {
	// object instance (data)
	Object *v2.Object `protobuf:"bytes,2,opt,name=object,proto3,oneof"`
}

type ExportResponse_ObjectType

type ExportResponse_ObjectType struct {
	// object type instance (metadata)
	ObjectType *v2.ObjectType `protobuf:"bytes,3,opt,name=object_type,json=objectType,proto3,oneof"`
}

type ExportResponse_Permission

type ExportResponse_Permission struct {
	// permission instance (metadata)
	Permission *v2.Permission `protobuf:"bytes,6,opt,name=permission,proto3,oneof"`
}

type ExportResponse_Relation

type ExportResponse_Relation struct {
	// relation instance (data)
	Relation *v2.Relation `protobuf:"bytes,4,opt,name=relation,proto3,oneof"`
}

type ExportResponse_RelationType

type ExportResponse_RelationType struct {
	// relation type instance (metadata)
	RelationType *v2.RelationType `protobuf:"bytes,5,opt,name=relation_type,json=relationType,proto3,oneof"`
}

type ExporterClient

type ExporterClient interface {
	Export(ctx context.Context, in *ExportRequest, opts ...grpc.CallOption) (Exporter_ExportClient, error)
}

ExporterClient is the client API for Exporter 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 NewExporterClient

func NewExporterClient(cc grpc.ClientConnInterface) ExporterClient

type ExporterServer

type ExporterServer interface {
	Export(*ExportRequest, Exporter_ExportServer) error
}

ExporterServer is the server API for Exporter service. All implementations should embed UnimplementedExporterServer for forward compatibility

type Exporter_ExportClient

type Exporter_ExportClient interface {
	Recv() (*ExportResponse, error)
	grpc.ClientStream
}

type Exporter_ExportServer

type Exporter_ExportServer interface {
	Send(*ExportResponse) error
	grpc.ServerStream
}

type Option

type Option int32
const (
	// nothing selected (default initialization value)
	Option_OPTION_UNKNOWN Option = 0
	// object type metadata
	Option_OPTION_METADATA_OBJECT_TYPES Option = 1
	// relation type metadata
	Option_OPTION_METADATA_RELATION_TYPES Option = 2
	// permission metadata
	Option_OPTION_METADATA_PERMISSIONS Option = 4
	// all metadata = OPTION_METADATA_OBJECT_TYPES | OPTION_METADATA_RELATION_TYPES | OPTION_METADATA_PERMISSIONS
	Option_OPTION_METADATA Option = 7
	// object instances
	Option_OPTION_DATA_OBJECTS Option = 8
	// relation instances
	Option_OPTION_DATA_RELATIONS Option = 16
	// relation instances with key values
	Option_OPTION_DATA_RELATIONS_WITH_KEYS Option = 32
	// all data = OPTION_DATA_OBJECTS | OPTION_DATA_RELATIONS
	Option_OPTION_DATA Option = 24
	// all data with keys = OPTION_DATA_OBJECTS | OPTION_DATA_RELATIONS_WITH_KEYS
	Option_OPTION_DATA_WITH_KEYS Option = 40
	// all metadata and data = OPTION_METADATA | OPTION_DATA
	Option_OPTION_ALL Option = 31
	// all metadata and data with keys = OPTION_METADATA | OPTION_DATA_WITH_KEYS
	Option_OPTION_ALL_WITH_KEYS Option = 47
)

func (Option) Descriptor

func (Option) Descriptor() protoreflect.EnumDescriptor

func (Option) Enum

func (x Option) Enum() *Option

func (Option) EnumDescriptor deprecated

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

Deprecated: Use Option.Descriptor instead.

func (Option) Number

func (x Option) Number() protoreflect.EnumNumber

func (Option) String

func (x Option) String() string

func (Option) Type

func (Option) Type() protoreflect.EnumType

type UnimplementedExporterServer

type UnimplementedExporterServer struct {
}

UnimplementedExporterServer should be embedded to have forward compatible implementations.

func (UnimplementedExporterServer) Export

type UnsafeExporterServer

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

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

Jump to

Keyboard shortcuts

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