Documentation ¶
Overview ¶
Package directorytypes is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Constants
- Variables
- func RegisterDirectoryServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterDirectoryServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client DirectoryServiceClient) error
- func RegisterDirectoryServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterDirectoryServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server DirectoryServiceServer) error
- func RegisterDirectoryServiceServer(s grpc.ServiceRegistrar, srv DirectoryServiceServer)
- type DirectoryServiceClient
- type DirectoryServiceServer
- type DirectoryService_QueryClient
- type DirectoryService_QueryServer
- type Query
- type Query_Reply
- func (*Query_Reply) Descriptor() ([]byte, []int)deprecated
- func (x *Query_Reply) GetAccountUri() string
- func (x *Query_Reply) GetDirectoryIdentifier() string
- func (x *Query_Reply) GetExpiresAt() int64
- func (x *Query_Reply) GetVerifiedCredential() []byte
- func (*Query_Reply) ProtoMessage()
- func (x *Query_Reply) ProtoReflect() protoreflect.Message
- func (x *Query_Reply) Reset()
- func (x *Query_Reply) String() string
- type Query_Request
- type Record
- func (*Record) Descriptor() ([]byte, []int)deprecated
- func (x *Record) GetAccountUri() string
- func (x *Record) GetDirectoryIdentifier() string
- func (x *Record) GetDirectoryRecordToken() string
- func (x *Record) GetExpiresAt() int64
- func (x *Record) GetLockedUntil() int64
- func (x *Record) GetUnregisterToken() string
- func (x *Record) GetVerifiedCredential() []byte
- func (*Record) ProtoMessage()
- func (x *Record) ProtoReflect() protoreflect.Message
- func (x *Record) Reset()
- func (x *Record) String() string
- type Register
- type Register_Reply
- func (*Register_Reply) Descriptor() ([]byte, []int)deprecated
- func (x *Register_Reply) GetDirectoryIdentifier() string
- func (x *Register_Reply) GetDirectoryRecordToken() string
- func (x *Register_Reply) GetExpirationDate() int64
- func (x *Register_Reply) GetUnregisterToken() string
- func (*Register_Reply) ProtoMessage()
- func (x *Register_Reply) ProtoReflect() protoreflect.Message
- func (x *Register_Reply) Reset()
- func (x *Register_Reply) String() string
- type Register_Request
- func (*Register_Request) Descriptor() ([]byte, []int)deprecated
- func (x *Register_Request) GetAccountUri() string
- func (x *Register_Request) GetExpirationDate() int64
- func (x *Register_Request) GetLockedUntilDate() int64
- func (x *Register_Request) GetOverwriteExistingRecord() bool
- func (x *Register_Request) GetVerifiedCredential() []byte
- func (*Register_Request) ProtoMessage()
- func (x *Register_Request) ProtoReflect() protoreflect.Message
- func (x *Register_Request) Reset()
- func (x *Register_Request) String() string
- type UnimplementedDirectoryServiceServer
- func (UnimplementedDirectoryServiceServer) Query(*Query_Request, grpc.ServerStreamingServer[Query_Reply]) error
- func (UnimplementedDirectoryServiceServer) Register(context.Context, *Register_Request) (*Register_Reply, error)
- func (UnimplementedDirectoryServiceServer) Unregister(context.Context, *Unregister_Request) (*Unregister_Reply, error)
- type Unregister
- type Unregister_Reply
- type Unregister_Request
- func (*Unregister_Request) Descriptor() ([]byte, []int)deprecated
- func (x *Unregister_Request) GetDirectoryIdentifier() string
- func (x *Unregister_Request) GetDirectoryRecordToken() string
- func (x *Unregister_Request) GetUnregisterToken() string
- func (*Unregister_Request) ProtoMessage()
- func (x *Unregister_Request) ProtoReflect() protoreflect.Message
- func (x *Unregister_Request) Reset()
- func (x *Unregister_Request) String() string
- type UnsafeDirectoryServiceServer
Constants ¶
const ( DirectoryService_Register_FullMethodName = "/berty.directory.v1.DirectoryService/Register" DirectoryService_Query_FullMethodName = "/berty.directory.v1.DirectoryService/Query" DirectoryService_Unregister_FullMethodName = "/berty.directory.v1.DirectoryService/Unregister" )
Variables ¶
var DirectoryService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "berty.directory.v1.DirectoryService", HandlerType: (*DirectoryServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Register", Handler: _DirectoryService_Register_Handler, }, { MethodName: "Unregister", Handler: _DirectoryService_Unregister_Handler, }, }, Streams: []grpc.StreamDesc{ { StreamName: "Query", Handler: _DirectoryService_Query_Handler, ServerStreams: true, }, }, Metadata: "directorytypes/bertydirectory.proto", }
DirectoryService_ServiceDesc is the grpc.ServiceDesc for DirectoryService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_directorytypes_bertydirectory_proto protoreflect.FileDescriptor
Functions ¶
func RegisterDirectoryServiceHandler ¶
func RegisterDirectoryServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterDirectoryServiceHandler registers the http handlers for service DirectoryService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterDirectoryServiceHandlerClient ¶
func RegisterDirectoryServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client DirectoryServiceClient) error
RegisterDirectoryServiceHandlerClient registers the http handlers for service DirectoryService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "DirectoryServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "DirectoryServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "DirectoryServiceClient" to call the correct interceptors.
func RegisterDirectoryServiceHandlerFromEndpoint ¶
func RegisterDirectoryServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterDirectoryServiceHandlerFromEndpoint is same as RegisterDirectoryServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterDirectoryServiceHandlerServer ¶
func RegisterDirectoryServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server DirectoryServiceServer) error
RegisterDirectoryServiceHandlerServer registers the http handlers for service DirectoryService to "mux". UnaryRPC :call DirectoryServiceServer 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 RegisterDirectoryServiceHandlerFromEndpoint instead.
func RegisterDirectoryServiceServer ¶
func RegisterDirectoryServiceServer(s grpc.ServiceRegistrar, srv DirectoryServiceServer)
Types ¶
type DirectoryServiceClient ¶
type DirectoryServiceClient interface { Register(ctx context.Context, in *Register_Request, opts ...grpc.CallOption) (*Register_Reply, error) Query(ctx context.Context, in *Query_Request, opts ...grpc.CallOption) (grpc.ServerStreamingClient[Query_Reply], error) Unregister(ctx context.Context, in *Unregister_Request, opts ...grpc.CallOption) (*Unregister_Reply, error) }
DirectoryServiceClient is the client API for DirectoryService 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.
DirectoryService
func NewDirectoryServiceClient ¶
func NewDirectoryServiceClient(cc grpc.ClientConnInterface) DirectoryServiceClient
type DirectoryServiceServer ¶
type DirectoryServiceServer interface { Register(context.Context, *Register_Request) (*Register_Reply, error) Query(*Query_Request, grpc.ServerStreamingServer[Query_Reply]) error Unregister(context.Context, *Unregister_Request) (*Unregister_Reply, error) // contains filtered or unexported methods }
DirectoryServiceServer is the server API for DirectoryService service. All implementations must embed UnimplementedDirectoryServiceServer for forward compatibility.
DirectoryService
type DirectoryService_QueryClient ¶
type DirectoryService_QueryClient = grpc.ServerStreamingClient[Query_Reply]
This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type DirectoryService_QueryServer ¶
type DirectoryService_QueryServer = grpc.ServerStreamingServer[Query_Reply]
This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type Query ¶
type Query struct {
// contains filtered or unexported fields
}
func (*Query) Descriptor
deprecated
func (*Query) ProtoMessage ¶
func (*Query) ProtoMessage()
func (*Query) ProtoReflect ¶ added in v2.470.4
func (x *Query) ProtoReflect() protoreflect.Message
type Query_Reply ¶
type Query_Reply struct { DirectoryIdentifier string `protobuf:"bytes,1,opt,name=directory_identifier,json=directoryIdentifier,proto3" json:"directory_identifier,omitempty"` ExpiresAt int64 `protobuf:"varint,2,opt,name=expires_at,json=expiresAt,proto3" json:"expires_at,omitempty"` AccountUri string `protobuf:"bytes,3,opt,name=account_uri,json=accountUri,proto3" json:"account_uri,omitempty"` VerifiedCredential []byte `protobuf:"bytes,4,opt,name=verified_credential,json=verifiedCredential,proto3" json:"verified_credential,omitempty"` // contains filtered or unexported fields }
func (*Query_Reply) Descriptor
deprecated
func (*Query_Reply) Descriptor() ([]byte, []int)
Deprecated: Use Query_Reply.ProtoReflect.Descriptor instead.
func (*Query_Reply) GetAccountUri ¶ added in v2.470.4
func (x *Query_Reply) GetAccountUri() string
func (*Query_Reply) GetDirectoryIdentifier ¶
func (x *Query_Reply) GetDirectoryIdentifier() string
func (*Query_Reply) GetExpiresAt ¶
func (x *Query_Reply) GetExpiresAt() int64
func (*Query_Reply) GetVerifiedCredential ¶
func (x *Query_Reply) GetVerifiedCredential() []byte
func (*Query_Reply) ProtoMessage ¶
func (*Query_Reply) ProtoMessage()
func (*Query_Reply) ProtoReflect ¶ added in v2.470.4
func (x *Query_Reply) ProtoReflect() protoreflect.Message
func (*Query_Reply) Reset ¶
func (x *Query_Reply) Reset()
func (*Query_Reply) String ¶
func (x *Query_Reply) String() string
type Query_Request ¶
type Query_Request struct { DirectoryIdentifiers []string `protobuf:"bytes,1,rep,name=directory_identifiers,json=directoryIdentifiers,proto3" json:"directory_identifiers,omitempty"` // contains filtered or unexported fields }
func (*Query_Request) Descriptor
deprecated
func (*Query_Request) Descriptor() ([]byte, []int)
Deprecated: Use Query_Request.ProtoReflect.Descriptor instead.
func (*Query_Request) GetDirectoryIdentifiers ¶
func (x *Query_Request) GetDirectoryIdentifiers() []string
func (*Query_Request) ProtoMessage ¶
func (*Query_Request) ProtoMessage()
func (*Query_Request) ProtoReflect ¶ added in v2.470.4
func (x *Query_Request) ProtoReflect() protoreflect.Message
func (*Query_Request) Reset ¶
func (x *Query_Request) Reset()
func (*Query_Request) String ¶
func (x *Query_Request) String() string
type Record ¶
type Record struct { DirectoryIdentifier string `` /* 162-byte string literal not displayed */ DirectoryRecordToken string `protobuf:"bytes,2,opt,name=directory_record_token,json=directoryRecordToken,proto3" json:"directory_record_token,omitempty"` ExpiresAt int64 `protobuf:"varint,3,opt,name=expires_at,json=expiresAt,proto3" json:"expires_at,omitempty"` LockedUntil int64 `protobuf:"varint,4,opt,name=locked_until,json=lockedUntil,proto3" json:"locked_until,omitempty"` UnregisterToken string `protobuf:"bytes,5,opt,name=unregister_token,json=unregisterToken,proto3" json:"unregister_token,omitempty"` AccountUri string `protobuf:"bytes,6,opt,name=account_uri,json=accountUri,proto3" json:"account_uri,omitempty"` VerifiedCredential []byte `protobuf:"bytes,7,opt,name=verified_credential,json=verifiedCredential,proto3" json:"verified_credential,omitempty"` // contains filtered or unexported fields }
func (*Record) Descriptor
deprecated
func (*Record) GetAccountUri ¶ added in v2.470.4
func (*Record) GetDirectoryIdentifier ¶
func (*Record) GetDirectoryRecordToken ¶
func (*Record) GetExpiresAt ¶
func (*Record) GetLockedUntil ¶
func (*Record) GetUnregisterToken ¶ added in v2.452.0
func (*Record) GetVerifiedCredential ¶
func (*Record) ProtoMessage ¶
func (*Record) ProtoMessage()
func (*Record) ProtoReflect ¶ added in v2.470.4
func (x *Record) ProtoReflect() protoreflect.Message
type Register ¶
type Register struct {
// contains filtered or unexported fields
}
func (*Register) Descriptor
deprecated
func (*Register) ProtoMessage ¶
func (*Register) ProtoMessage()
func (*Register) ProtoReflect ¶ added in v2.470.4
func (x *Register) ProtoReflect() protoreflect.Message
type Register_Reply ¶
type Register_Reply struct { DirectoryRecordToken string `protobuf:"bytes,1,opt,name=directory_record_token,json=directoryRecordToken,proto3" json:"directory_record_token,omitempty"` DirectoryIdentifier string `protobuf:"bytes,2,opt,name=directory_identifier,json=directoryIdentifier,proto3" json:"directory_identifier,omitempty"` ExpirationDate int64 `protobuf:"varint,3,opt,name=expiration_date,json=expirationDate,proto3" json:"expiration_date,omitempty"` UnregisterToken string `protobuf:"bytes,4,opt,name=unregister_token,json=unregisterToken,proto3" json:"unregister_token,omitempty"` // contains filtered or unexported fields }
func (*Register_Reply) Descriptor
deprecated
func (*Register_Reply) Descriptor() ([]byte, []int)
Deprecated: Use Register_Reply.ProtoReflect.Descriptor instead.
func (*Register_Reply) GetDirectoryIdentifier ¶
func (x *Register_Reply) GetDirectoryIdentifier() string
func (*Register_Reply) GetDirectoryRecordToken ¶
func (x *Register_Reply) GetDirectoryRecordToken() string
func (*Register_Reply) GetExpirationDate ¶
func (x *Register_Reply) GetExpirationDate() int64
func (*Register_Reply) GetUnregisterToken ¶ added in v2.452.0
func (x *Register_Reply) GetUnregisterToken() string
func (*Register_Reply) ProtoMessage ¶
func (*Register_Reply) ProtoMessage()
func (*Register_Reply) ProtoReflect ¶ added in v2.470.4
func (x *Register_Reply) ProtoReflect() protoreflect.Message
func (*Register_Reply) Reset ¶
func (x *Register_Reply) Reset()
func (*Register_Reply) String ¶
func (x *Register_Reply) String() string
type Register_Request ¶
type Register_Request struct { VerifiedCredential []byte `protobuf:"bytes,1,opt,name=verified_credential,json=verifiedCredential,proto3" json:"verified_credential,omitempty"` ExpirationDate int64 `protobuf:"varint,2,opt,name=expiration_date,json=expirationDate,proto3" json:"expiration_date,omitempty"` LockedUntilDate int64 `protobuf:"varint,3,opt,name=locked_until_date,json=lockedUntilDate,proto3" json:"locked_until_date,omitempty"` AccountUri string `protobuf:"bytes,4,opt,name=account_uri,json=accountUri,proto3" json:"account_uri,omitempty"` OverwriteExistingRecord bool `` /* 133-byte string literal not displayed */ // contains filtered or unexported fields }
func (*Register_Request) Descriptor
deprecated
func (*Register_Request) Descriptor() ([]byte, []int)
Deprecated: Use Register_Request.ProtoReflect.Descriptor instead.
func (*Register_Request) GetAccountUri ¶ added in v2.470.4
func (x *Register_Request) GetAccountUri() string
func (*Register_Request) GetExpirationDate ¶
func (x *Register_Request) GetExpirationDate() int64
func (*Register_Request) GetLockedUntilDate ¶
func (x *Register_Request) GetLockedUntilDate() int64
func (*Register_Request) GetOverwriteExistingRecord ¶
func (x *Register_Request) GetOverwriteExistingRecord() bool
func (*Register_Request) GetVerifiedCredential ¶
func (x *Register_Request) GetVerifiedCredential() []byte
func (*Register_Request) ProtoMessage ¶
func (*Register_Request) ProtoMessage()
func (*Register_Request) ProtoReflect ¶ added in v2.470.4
func (x *Register_Request) ProtoReflect() protoreflect.Message
func (*Register_Request) Reset ¶
func (x *Register_Request) Reset()
func (*Register_Request) String ¶
func (x *Register_Request) String() string
type UnimplementedDirectoryServiceServer ¶
type UnimplementedDirectoryServiceServer struct{}
UnimplementedDirectoryServiceServer must 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 (UnimplementedDirectoryServiceServer) Register ¶
func (UnimplementedDirectoryServiceServer) Register(context.Context, *Register_Request) (*Register_Reply, error)
func (UnimplementedDirectoryServiceServer) Unregister ¶
func (UnimplementedDirectoryServiceServer) Unregister(context.Context, *Unregister_Request) (*Unregister_Reply, error)
type Unregister ¶
type Unregister struct {
// contains filtered or unexported fields
}
func (*Unregister) Descriptor
deprecated
func (*Unregister) Descriptor() ([]byte, []int)
Deprecated: Use Unregister.ProtoReflect.Descriptor instead.
func (*Unregister) ProtoMessage ¶
func (*Unregister) ProtoMessage()
func (*Unregister) ProtoReflect ¶ added in v2.470.4
func (x *Unregister) ProtoReflect() protoreflect.Message
func (*Unregister) Reset ¶
func (x *Unregister) Reset()
func (*Unregister) String ¶
func (x *Unregister) String() string
type Unregister_Reply ¶
type Unregister_Reply struct {
// contains filtered or unexported fields
}
func (*Unregister_Reply) Descriptor
deprecated
func (*Unregister_Reply) Descriptor() ([]byte, []int)
Deprecated: Use Unregister_Reply.ProtoReflect.Descriptor instead.
func (*Unregister_Reply) ProtoMessage ¶
func (*Unregister_Reply) ProtoMessage()
func (*Unregister_Reply) ProtoReflect ¶ added in v2.470.4
func (x *Unregister_Reply) ProtoReflect() protoreflect.Message
func (*Unregister_Reply) Reset ¶
func (x *Unregister_Reply) Reset()
func (*Unregister_Reply) String ¶
func (x *Unregister_Reply) String() string
type Unregister_Request ¶
type Unregister_Request struct { DirectoryIdentifier string `protobuf:"bytes,1,opt,name=directory_identifier,json=directoryIdentifier,proto3" json:"directory_identifier,omitempty"` DirectoryRecordToken string `protobuf:"bytes,2,opt,name=directory_record_token,json=directoryRecordToken,proto3" json:"directory_record_token,omitempty"` UnregisterToken string `protobuf:"bytes,3,opt,name=unregister_token,json=unregisterToken,proto3" json:"unregister_token,omitempty"` // when not known (ie. device lost) the user can either wait for the record to expire or register again (if the record is still present but unlocked) and then unregister // contains filtered or unexported fields }
func (*Unregister_Request) Descriptor
deprecated
func (*Unregister_Request) Descriptor() ([]byte, []int)
Deprecated: Use Unregister_Request.ProtoReflect.Descriptor instead.
func (*Unregister_Request) GetDirectoryIdentifier ¶
func (x *Unregister_Request) GetDirectoryIdentifier() string
func (*Unregister_Request) GetDirectoryRecordToken ¶
func (x *Unregister_Request) GetDirectoryRecordToken() string
func (*Unregister_Request) GetUnregisterToken ¶ added in v2.452.0
func (x *Unregister_Request) GetUnregisterToken() string
func (*Unregister_Request) ProtoMessage ¶
func (*Unregister_Request) ProtoMessage()
func (*Unregister_Request) ProtoReflect ¶ added in v2.470.4
func (x *Unregister_Request) ProtoReflect() protoreflect.Message
func (*Unregister_Request) Reset ¶
func (x *Unregister_Request) Reset()
func (*Unregister_Request) String ¶
func (x *Unregister_Request) String() string
type UnsafeDirectoryServiceServer ¶ added in v2.455.0
type UnsafeDirectoryServiceServer interface {
// contains filtered or unexported methods
}
UnsafeDirectoryServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to DirectoryServiceServer will result in compilation errors.