exporter

package
v0.30.10 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2024 License: Apache-2.0 Imports: 18 Imported by: 10

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.v3.Exporter/Export"
)

Variables

View Source
var (
	Option_name = map[int32]string{
		0:  "OPTION_UNKNOWN",
		8:  "OPTION_DATA_OBJECTS",
		16: "OPTION_DATA_RELATIONS",
		24: "OPTION_DATA",
		64: "OPTION_STATS",
	}
	Option_value = map[string]int32{
		"OPTION_UNKNOWN":        0,
		"OPTION_DATA_OBJECTS":   8,
		"OPTION_DATA_RELATIONS": 16,
		"OPTION_DATA":           24,
		"OPTION_STATS":          64,
	}
)

Enum value maps for Option.

View Source
var Exporter_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "aserto.directory.exporter.v3.Exporter",
	HandlerType: (*ExporterServer)(nil),
	Methods:     []grpc.MethodDesc{},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "Export",
			Handler:       _Exporter_Export_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "aserto/directory/exporter/v3/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_v3_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_Relation
	//	*ExportResponse_Stats
	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() *v3.Object

func (*ExportResponse) GetRelation

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

func (*ExportResponse) GetStats added in v0.30.6

func (x *ExportResponse) GetStats() *structpb.Struct

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

type ExportResponse_Relation

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

type ExportResponse_Stats added in v0.30.6

type ExportResponse_Stats struct {
	// object and/or relation stats (no data)
	Stats *structpb.Struct `protobuf:"bytes,8,opt,name=stats,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 instances
	Option_OPTION_DATA_OBJECTS Option = 8
	// relation instances
	Option_OPTION_DATA_RELATIONS Option = 16
	// all data = OPTION_DATA_OBJECTS | OPTION_DATA_RELATIONS
	Option_OPTION_DATA Option = 24
	// stats
	Option_OPTION_STATS Option = 64
)

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