Documentation ¶
Overview ¶
Package writer is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Constants
- Variables
- func RegisterWriterHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterWriterHandlerClient(ctx context.Context, mux *runtime.ServeMux, client WriterClient) error
- func RegisterWriterHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterWriterHandlerServer(ctx context.Context, mux *runtime.ServeMux, server WriterServer) error
- func RegisterWriterServer(s grpc.ServiceRegistrar, srv WriterServer)
- type DeleteObjectRequest
- func (*DeleteObjectRequest) Descriptor() ([]byte, []int)deprecated
- func (x *DeleteObjectRequest) GetObjectId() string
- func (x *DeleteObjectRequest) GetObjectType() string
- func (x *DeleteObjectRequest) GetWithRelations() bool
- func (*DeleteObjectRequest) ProtoMessage()
- func (x *DeleteObjectRequest) ProtoReflect() protoreflect.Message
- func (x *DeleteObjectRequest) Reset()
- func (x *DeleteObjectRequest) String() string
- type DeleteObjectResponse
- func (*DeleteObjectResponse) Descriptor() ([]byte, []int)deprecated
- func (x *DeleteObjectResponse) GetResult() *emptypb.Empty
- func (*DeleteObjectResponse) ProtoMessage()
- func (x *DeleteObjectResponse) ProtoReflect() protoreflect.Message
- func (x *DeleteObjectResponse) Reset()
- func (x *DeleteObjectResponse) String() string
- type DeleteRelationRequest
- func (*DeleteRelationRequest) Descriptor() ([]byte, []int)deprecated
- func (x *DeleteRelationRequest) GetObjectId() string
- func (x *DeleteRelationRequest) GetObjectType() string
- func (x *DeleteRelationRequest) GetRelation() string
- func (x *DeleteRelationRequest) GetSubjectId() string
- func (x *DeleteRelationRequest) GetSubjectRelation() string
- func (x *DeleteRelationRequest) GetSubjectType() string
- func (*DeleteRelationRequest) ProtoMessage()
- func (x *DeleteRelationRequest) ProtoReflect() protoreflect.Message
- func (x *DeleteRelationRequest) Reset()
- func (x *DeleteRelationRequest) String() string
- type DeleteRelationResponse
- func (*DeleteRelationResponse) Descriptor() ([]byte, []int)deprecated
- func (x *DeleteRelationResponse) GetResult() *emptypb.Empty
- func (*DeleteRelationResponse) ProtoMessage()
- func (x *DeleteRelationResponse) ProtoReflect() protoreflect.Message
- func (x *DeleteRelationResponse) Reset()
- func (x *DeleteRelationResponse) String() string
- type SetObjectRequest
- type SetObjectResponse
- func (*SetObjectResponse) Descriptor() ([]byte, []int)deprecated
- func (x *SetObjectResponse) GetResult() *v3.Object
- func (*SetObjectResponse) ProtoMessage()
- func (x *SetObjectResponse) ProtoReflect() protoreflect.Message
- func (x *SetObjectResponse) Reset()
- func (x *SetObjectResponse) String() string
- type SetRelationRequest
- func (*SetRelationRequest) Descriptor() ([]byte, []int)deprecated
- func (x *SetRelationRequest) GetRelation() *v3.Relation
- func (*SetRelationRequest) ProtoMessage()
- func (x *SetRelationRequest) ProtoReflect() protoreflect.Message
- func (x *SetRelationRequest) Reset()
- func (x *SetRelationRequest) String() string
- type SetRelationResponse
- func (*SetRelationResponse) Descriptor() ([]byte, []int)deprecated
- func (x *SetRelationResponse) GetResult() *v3.Relation
- func (*SetRelationResponse) ProtoMessage()
- func (x *SetRelationResponse) ProtoReflect() protoreflect.Message
- func (x *SetRelationResponse) Reset()
- func (x *SetRelationResponse) String() string
- type UnimplementedWriterServer
- func (UnimplementedWriterServer) DeleteObject(context.Context, *DeleteObjectRequest) (*DeleteObjectResponse, error)
- func (UnimplementedWriterServer) DeleteRelation(context.Context, *DeleteRelationRequest) (*DeleteRelationResponse, error)
- func (UnimplementedWriterServer) SetObject(context.Context, *SetObjectRequest) (*SetObjectResponse, error)
- func (UnimplementedWriterServer) SetRelation(context.Context, *SetRelationRequest) (*SetRelationResponse, error)
- type UnsafeWriterServer
- type WriterClient
- type WriterServer
Constants ¶
const ( Writer_SetObject_FullMethodName = "/aserto.directory.writer.v3.Writer/SetObject" Writer_DeleteObject_FullMethodName = "/aserto.directory.writer.v3.Writer/DeleteObject" Writer_SetRelation_FullMethodName = "/aserto.directory.writer.v3.Writer/SetRelation" Writer_DeleteRelation_FullMethodName = "/aserto.directory.writer.v3.Writer/DeleteRelation" )
Variables ¶
var File_aserto_directory_writer_v3_writer_proto protoreflect.FileDescriptor
var Writer_ServiceDesc = grpc.ServiceDesc{ ServiceName: "aserto.directory.writer.v3.Writer", HandlerType: (*WriterServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "SetObject", Handler: _Writer_SetObject_Handler, }, { MethodName: "DeleteObject", Handler: _Writer_DeleteObject_Handler, }, { MethodName: "SetRelation", Handler: _Writer_SetRelation_Handler, }, { MethodName: "DeleteRelation", Handler: _Writer_DeleteRelation_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "aserto/directory/writer/v3/writer.proto", }
Writer_ServiceDesc is the grpc.ServiceDesc for Writer service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterWriterHandler ¶
RegisterWriterHandler registers the http handlers for service Writer to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterWriterHandlerClient ¶
func RegisterWriterHandlerClient(ctx context.Context, mux *runtime.ServeMux, client WriterClient) error
RegisterWriterHandlerClient registers the http handlers for service Writer to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "WriterClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "WriterClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "WriterClient" to call the correct interceptors. This client ignores the HTTP middlewares.
func RegisterWriterHandlerFromEndpoint ¶
func RegisterWriterHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterWriterHandlerFromEndpoint is same as RegisterWriterHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterWriterHandlerServer ¶
func RegisterWriterHandlerServer(ctx context.Context, mux *runtime.ServeMux, server WriterServer) error
RegisterWriterHandlerServer registers the http handlers for service Writer to "mux". UnaryRPC :call WriterServer 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 RegisterWriterHandlerFromEndpoint 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 RegisterWriterServer ¶
func RegisterWriterServer(s grpc.ServiceRegistrar, srv WriterServer)
Types ¶
type DeleteObjectRequest ¶
type DeleteObjectRequest struct { // object type ObjectType string `protobuf:"bytes,1,opt,name=object_type,json=objectType,proto3" json:"object_type,omitempty"` // object identifier ObjectId string `protobuf:"bytes,2,opt,name=object_id,json=objectId,proto3" json:"object_id,omitempty"` // delete object relations, both object and subject relations. WithRelations bool `protobuf:"varint,3,opt,name=with_relations,json=withRelations,proto3" json:"with_relations,omitempty"` // contains filtered or unexported fields }
func (*DeleteObjectRequest) Descriptor
deprecated
func (*DeleteObjectRequest) Descriptor() ([]byte, []int)
Deprecated: Use DeleteObjectRequest.ProtoReflect.Descriptor instead.
func (*DeleteObjectRequest) GetObjectId ¶
func (x *DeleteObjectRequest) GetObjectId() string
func (*DeleteObjectRequest) GetObjectType ¶
func (x *DeleteObjectRequest) GetObjectType() string
func (*DeleteObjectRequest) GetWithRelations ¶
func (x *DeleteObjectRequest) GetWithRelations() bool
func (*DeleteObjectRequest) ProtoMessage ¶
func (*DeleteObjectRequest) ProtoMessage()
func (*DeleteObjectRequest) ProtoReflect ¶
func (x *DeleteObjectRequest) ProtoReflect() protoreflect.Message
func (*DeleteObjectRequest) Reset ¶
func (x *DeleteObjectRequest) Reset()
func (*DeleteObjectRequest) String ¶
func (x *DeleteObjectRequest) String() string
type DeleteObjectResponse ¶
type DeleteObjectResponse struct { // empty result Result *emptypb.Empty `protobuf:"bytes,1,opt,name=result,proto3" json:"result,omitempty"` // contains filtered or unexported fields }
func (*DeleteObjectResponse) Descriptor
deprecated
func (*DeleteObjectResponse) Descriptor() ([]byte, []int)
Deprecated: Use DeleteObjectResponse.ProtoReflect.Descriptor instead.
func (*DeleteObjectResponse) GetResult ¶
func (x *DeleteObjectResponse) GetResult() *emptypb.Empty
func (*DeleteObjectResponse) ProtoMessage ¶
func (*DeleteObjectResponse) ProtoMessage()
func (*DeleteObjectResponse) ProtoReflect ¶
func (x *DeleteObjectResponse) ProtoReflect() protoreflect.Message
func (*DeleteObjectResponse) Reset ¶
func (x *DeleteObjectResponse) Reset()
func (*DeleteObjectResponse) String ¶
func (x *DeleteObjectResponse) String() string
type DeleteRelationRequest ¶
type DeleteRelationRequest struct { // object type ObjectType string `protobuf:"bytes,1,opt,name=object_type,json=objectType,proto3" json:"object_type,omitempty"` // object identifier ObjectId string `protobuf:"bytes,2,opt,name=object_id,json=objectId,proto3" json:"object_id,omitempty"` // object relation name Relation string `protobuf:"bytes,3,opt,name=relation,proto3" json:"relation,omitempty"` // subject type SubjectType string `protobuf:"bytes,4,opt,name=subject_type,json=subjectType,proto3" json:"subject_type,omitempty"` // subject identifier SubjectId string `protobuf:"bytes,5,opt,name=subject_id,json=subjectId,proto3" json:"subject_id,omitempty"` // optional subject relation name SubjectRelation string `protobuf:"bytes,6,opt,name=subject_relation,json=subjectRelation,proto3" json:"subject_relation,omitempty"` // contains filtered or unexported fields }
func (*DeleteRelationRequest) Descriptor
deprecated
func (*DeleteRelationRequest) Descriptor() ([]byte, []int)
Deprecated: Use DeleteRelationRequest.ProtoReflect.Descriptor instead.
func (*DeleteRelationRequest) GetObjectId ¶
func (x *DeleteRelationRequest) GetObjectId() string
func (*DeleteRelationRequest) GetObjectType ¶
func (x *DeleteRelationRequest) GetObjectType() string
func (*DeleteRelationRequest) GetRelation ¶
func (x *DeleteRelationRequest) GetRelation() string
func (*DeleteRelationRequest) GetSubjectId ¶
func (x *DeleteRelationRequest) GetSubjectId() string
func (*DeleteRelationRequest) GetSubjectRelation ¶
func (x *DeleteRelationRequest) GetSubjectRelation() string
func (*DeleteRelationRequest) GetSubjectType ¶
func (x *DeleteRelationRequest) GetSubjectType() string
func (*DeleteRelationRequest) ProtoMessage ¶
func (*DeleteRelationRequest) ProtoMessage()
func (*DeleteRelationRequest) ProtoReflect ¶
func (x *DeleteRelationRequest) ProtoReflect() protoreflect.Message
func (*DeleteRelationRequest) Reset ¶
func (x *DeleteRelationRequest) Reset()
func (*DeleteRelationRequest) String ¶
func (x *DeleteRelationRequest) String() string
type DeleteRelationResponse ¶
type DeleteRelationResponse struct { // empty result Result *emptypb.Empty `protobuf:"bytes,1,opt,name=result,proto3" json:"result,omitempty"` // contains filtered or unexported fields }
func (*DeleteRelationResponse) Descriptor
deprecated
func (*DeleteRelationResponse) Descriptor() ([]byte, []int)
Deprecated: Use DeleteRelationResponse.ProtoReflect.Descriptor instead.
func (*DeleteRelationResponse) GetResult ¶
func (x *DeleteRelationResponse) GetResult() *emptypb.Empty
func (*DeleteRelationResponse) ProtoMessage ¶
func (*DeleteRelationResponse) ProtoMessage()
func (*DeleteRelationResponse) ProtoReflect ¶
func (x *DeleteRelationResponse) ProtoReflect() protoreflect.Message
func (*DeleteRelationResponse) Reset ¶
func (x *DeleteRelationResponse) Reset()
func (*DeleteRelationResponse) String ¶
func (x *DeleteRelationResponse) String() string
type SetObjectRequest ¶
type SetObjectRequest struct { // object instance Object *v3.Object `protobuf:"bytes,1,opt,name=object,proto3" json:"object,omitempty"` // contains filtered or unexported fields }
func (*SetObjectRequest) Descriptor
deprecated
func (*SetObjectRequest) Descriptor() ([]byte, []int)
Deprecated: Use SetObjectRequest.ProtoReflect.Descriptor instead.
func (*SetObjectRequest) GetObject ¶
func (x *SetObjectRequest) GetObject() *v3.Object
func (*SetObjectRequest) ProtoMessage ¶
func (*SetObjectRequest) ProtoMessage()
func (*SetObjectRequest) ProtoReflect ¶
func (x *SetObjectRequest) ProtoReflect() protoreflect.Message
func (*SetObjectRequest) Reset ¶
func (x *SetObjectRequest) Reset()
func (*SetObjectRequest) String ¶
func (x *SetObjectRequest) String() string
type SetObjectResponse ¶
type SetObjectResponse struct { // object instance Result *v3.Object `protobuf:"bytes,1,opt,name=result,proto3" json:"result,omitempty"` // contains filtered or unexported fields }
func (*SetObjectResponse) Descriptor
deprecated
func (*SetObjectResponse) Descriptor() ([]byte, []int)
Deprecated: Use SetObjectResponse.ProtoReflect.Descriptor instead.
func (*SetObjectResponse) GetResult ¶
func (x *SetObjectResponse) GetResult() *v3.Object
func (*SetObjectResponse) ProtoMessage ¶
func (*SetObjectResponse) ProtoMessage()
func (*SetObjectResponse) ProtoReflect ¶
func (x *SetObjectResponse) ProtoReflect() protoreflect.Message
func (*SetObjectResponse) Reset ¶
func (x *SetObjectResponse) Reset()
func (*SetObjectResponse) String ¶
func (x *SetObjectResponse) String() string
type SetRelationRequest ¶
type SetRelationRequest struct { // relation instance Relation *v3.Relation `protobuf:"bytes,1,opt,name=relation,proto3" json:"relation,omitempty"` // contains filtered or unexported fields }
func (*SetRelationRequest) Descriptor
deprecated
func (*SetRelationRequest) Descriptor() ([]byte, []int)
Deprecated: Use SetRelationRequest.ProtoReflect.Descriptor instead.
func (*SetRelationRequest) GetRelation ¶
func (x *SetRelationRequest) GetRelation() *v3.Relation
func (*SetRelationRequest) ProtoMessage ¶
func (*SetRelationRequest) ProtoMessage()
func (*SetRelationRequest) ProtoReflect ¶
func (x *SetRelationRequest) ProtoReflect() protoreflect.Message
func (*SetRelationRequest) Reset ¶
func (x *SetRelationRequest) Reset()
func (*SetRelationRequest) String ¶
func (x *SetRelationRequest) String() string
type SetRelationResponse ¶
type SetRelationResponse struct { // relation instance Result *v3.Relation `protobuf:"bytes,1,opt,name=result,proto3" json:"result,omitempty"` // contains filtered or unexported fields }
func (*SetRelationResponse) Descriptor
deprecated
func (*SetRelationResponse) Descriptor() ([]byte, []int)
Deprecated: Use SetRelationResponse.ProtoReflect.Descriptor instead.
func (*SetRelationResponse) GetResult ¶
func (x *SetRelationResponse) GetResult() *v3.Relation
func (*SetRelationResponse) ProtoMessage ¶
func (*SetRelationResponse) ProtoMessage()
func (*SetRelationResponse) ProtoReflect ¶
func (x *SetRelationResponse) ProtoReflect() protoreflect.Message
func (*SetRelationResponse) Reset ¶
func (x *SetRelationResponse) Reset()
func (*SetRelationResponse) String ¶
func (x *SetRelationResponse) String() string
type UnimplementedWriterServer ¶
type UnimplementedWriterServer struct{}
UnimplementedWriterServer 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 (UnimplementedWriterServer) DeleteObject ¶
func (UnimplementedWriterServer) DeleteObject(context.Context, *DeleteObjectRequest) (*DeleteObjectResponse, error)
func (UnimplementedWriterServer) DeleteRelation ¶
func (UnimplementedWriterServer) DeleteRelation(context.Context, *DeleteRelationRequest) (*DeleteRelationResponse, error)
func (UnimplementedWriterServer) SetObject ¶
func (UnimplementedWriterServer) SetObject(context.Context, *SetObjectRequest) (*SetObjectResponse, error)
func (UnimplementedWriterServer) SetRelation ¶
func (UnimplementedWriterServer) SetRelation(context.Context, *SetRelationRequest) (*SetRelationResponse, error)
type UnsafeWriterServer ¶
type UnsafeWriterServer interface {
// contains filtered or unexported methods
}
UnsafeWriterServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to WriterServer will result in compilation errors.
type WriterClient ¶
type WriterClient interface { // set object instance SetObject(ctx context.Context, in *SetObjectRequest, opts ...grpc.CallOption) (*SetObjectResponse, error) // delete object instance DeleteObject(ctx context.Context, in *DeleteObjectRequest, opts ...grpc.CallOption) (*DeleteObjectResponse, error) // set relation instance SetRelation(ctx context.Context, in *SetRelationRequest, opts ...grpc.CallOption) (*SetRelationResponse, error) // delete relation instance DeleteRelation(ctx context.Context, in *DeleteRelationRequest, opts ...grpc.CallOption) (*DeleteRelationResponse, error) }
WriterClient is the client API for Writer 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 NewWriterClient ¶
func NewWriterClient(cc grpc.ClientConnInterface) WriterClient
type WriterServer ¶
type WriterServer interface { // set object instance SetObject(context.Context, *SetObjectRequest) (*SetObjectResponse, error) // delete object instance DeleteObject(context.Context, *DeleteObjectRequest) (*DeleteObjectResponse, error) // set relation instance SetRelation(context.Context, *SetRelationRequest) (*SetRelationResponse, error) // delete relation instance DeleteRelation(context.Context, *DeleteRelationRequest) (*DeleteRelationResponse, error) }
WriterServer is the server API for Writer service. All implementations should embed UnimplementedWriterServer for forward compatibility.