datapb

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2020 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Overview

Package datapb is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var (
	Scope_name = map[int32]string{
		0: "Public",
		1: "Personal",
		2: "ContextRestricted",
	}
	Scope_value = map[string]int32{
		"Public":            0,
		"Personal":          1,
		"ContextRestricted": 2,
	}
)

Enum value maps for Scope.

Functions

func RegisterDataStoreHandler

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

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

func RegisterDataStoreHandlerClient

func RegisterDataStoreHandlerClient(ctx context.Context, mux *runtime.ServeMux, client DataStoreClient) error

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

func RegisterDataStoreHandlerFromEndpoint

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

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

func RegisterDataStoreHandlerServer

func RegisterDataStoreHandlerServer(ctx context.Context, mux *runtime.ServeMux, server DataStoreServer) error

RegisterDataStoreHandlerServer registers the http handlers for service DataStore to "mux". UnaryRPC :call DataStoreServer 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 RegisterDataStoreHandlerFromEndpoint instead.

func RegisterDataStoreServer

func RegisterDataStoreServer(s grpc.ServiceRegistrar, srv DataStoreServer)

Types

type Data

type Data struct {
	Context string `protobuf:"bytes,1,opt,name=context,proto3" json:"context,omitempty"`
	Name    string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	Uri     string `protobuf:"bytes,3,opt,name=uri,proto3" json:"uri,omitempty"`
	// contains filtered or unexported fields
}

func (*Data) Descriptor deprecated

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

Deprecated: Use Data.ProtoReflect.Descriptor instead.

func (*Data) GetContext

func (x *Data) GetContext() string

func (*Data) GetName

func (x *Data) GetName() string

func (*Data) GetUri

func (x *Data) GetUri() string

func (*Data) ProtoMessage

func (*Data) ProtoMessage()

func (*Data) ProtoReflect

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

func (*Data) Reset

func (x *Data) Reset()

func (*Data) String

func (x *Data) String() string

type DataStoreClient

type DataStoreClient interface {
	SetData(ctx context.Context, in *SetDataRequest, opts ...grpc.CallOption) (*SetDataResponse, error)
	GetData(ctx context.Context, in *GetDataRequest, opts ...grpc.CallOption) (*GetDataResponse, error)
	DeleteData(ctx context.Context, in *DeleteDataRequest, opts ...grpc.CallOption) (*DeleteDataResponse, error)
}

DataStoreClient is the client API for DataStore 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 NewDataStoreClient

func NewDataStoreClient(cc grpc.ClientConnInterface) DataStoreClient

type DataStoreServer

type DataStoreServer interface {
	SetData(context.Context, *SetDataRequest) (*SetDataResponse, error)
	GetData(context.Context, *GetDataRequest) (*GetDataResponse, error)
	DeleteData(context.Context, *DeleteDataRequest) (*DeleteDataResponse, error)
	// contains filtered or unexported methods
}

DataStoreServer is the server API for DataStore service. All implementations must embed UnimplementedDataStoreServer for forward compatibility

type DeleteDataRequest

type DeleteDataRequest struct {
	Subject string `protobuf:"bytes,1,opt,name=subject,proto3" json:"subject,omitempty"`
	Context string `protobuf:"bytes,2,opt,name=context,proto3" json:"context,omitempty"`
	Name    string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"`
	// contains filtered or unexported fields
}

func (*DeleteDataRequest) Descriptor deprecated

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

Deprecated: Use DeleteDataRequest.ProtoReflect.Descriptor instead.

func (*DeleteDataRequest) GetContext

func (x *DeleteDataRequest) GetContext() string

func (*DeleteDataRequest) GetName

func (x *DeleteDataRequest) GetName() string

func (*DeleteDataRequest) GetSubject

func (x *DeleteDataRequest) GetSubject() string

func (*DeleteDataRequest) ProtoMessage

func (*DeleteDataRequest) ProtoMessage()

func (*DeleteDataRequest) ProtoReflect

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

func (*DeleteDataRequest) Reset

func (x *DeleteDataRequest) Reset()

func (*DeleteDataRequest) String

func (x *DeleteDataRequest) String() string

type DeleteDataResponse

type DeleteDataResponse struct {
	// contains filtered or unexported fields
}

func (*DeleteDataResponse) Descriptor deprecated

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

Deprecated: Use DeleteDataResponse.ProtoReflect.Descriptor instead.

func (*DeleteDataResponse) ProtoMessage

func (*DeleteDataResponse) ProtoMessage()

func (*DeleteDataResponse) ProtoReflect

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

func (*DeleteDataResponse) Reset

func (x *DeleteDataResponse) Reset()

func (*DeleteDataResponse) String

func (x *DeleteDataResponse) String() string

type GetDataRequest

type GetDataRequest struct {
	Context string `protobuf:"bytes,1,opt,name=context,proto3" json:"context,omitempty"`
	Name    string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	// contains filtered or unexported fields
}

func (*GetDataRequest) Descriptor deprecated

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

Deprecated: Use GetDataRequest.ProtoReflect.Descriptor instead.

func (*GetDataRequest) GetContext

func (x *GetDataRequest) GetContext() string

func (*GetDataRequest) GetName

func (x *GetDataRequest) GetName() string

func (*GetDataRequest) ProtoMessage

func (*GetDataRequest) ProtoMessage()

func (*GetDataRequest) ProtoReflect

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

func (*GetDataRequest) Reset

func (x *GetDataRequest) Reset()

func (*GetDataRequest) String

func (x *GetDataRequest) String() string

type GetDataResponse

type GetDataResponse struct {
	Data *Data `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

func (*GetDataResponse) Descriptor deprecated

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

Deprecated: Use GetDataResponse.ProtoReflect.Descriptor instead.

func (*GetDataResponse) GetData

func (x *GetDataResponse) GetData() *Data

func (*GetDataResponse) ProtoMessage

func (*GetDataResponse) ProtoMessage()

func (*GetDataResponse) ProtoReflect

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

func (*GetDataResponse) Reset

func (x *GetDataResponse) Reset()

func (*GetDataResponse) String

func (x *GetDataResponse) String() string

type Scope

type Scope int32
const (
	Scope_Public            Scope = 0
	Scope_Personal          Scope = 1
	Scope_ContextRestricted Scope = 2
)

func (Scope) Descriptor

func (Scope) Descriptor() protoreflect.EnumDescriptor

func (Scope) Enum

func (x Scope) Enum() *Scope

func (Scope) EnumDescriptor deprecated

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

Deprecated: Use Scope.Descriptor instead.

func (Scope) Number

func (x Scope) Number() protoreflect.EnumNumber

func (Scope) String

func (x Scope) String() string

func (Scope) Type

func (Scope) Type() protoreflect.EnumType

type SetDataRequest

type SetDataRequest struct {
	Subject string `protobuf:"bytes,1,opt,name=subject,proto3" json:"subject,omitempty"`
	Data    *Data  `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

func (*SetDataRequest) Descriptor deprecated

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

Deprecated: Use SetDataRequest.ProtoReflect.Descriptor instead.

func (*SetDataRequest) GetData

func (x *SetDataRequest) GetData() *Data

func (*SetDataRequest) GetSubject

func (x *SetDataRequest) GetSubject() string

func (*SetDataRequest) ProtoMessage

func (*SetDataRequest) ProtoMessage()

func (*SetDataRequest) ProtoReflect

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

func (*SetDataRequest) Reset

func (x *SetDataRequest) Reset()

func (*SetDataRequest) String

func (x *SetDataRequest) String() string

type SetDataResponse

type SetDataResponse struct {
	// contains filtered or unexported fields
}

func (*SetDataResponse) Descriptor deprecated

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

Deprecated: Use SetDataResponse.ProtoReflect.Descriptor instead.

func (*SetDataResponse) ProtoMessage

func (*SetDataResponse) ProtoMessage()

func (*SetDataResponse) ProtoReflect

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

func (*SetDataResponse) Reset

func (x *SetDataResponse) Reset()

func (*SetDataResponse) String

func (x *SetDataResponse) String() string

type UnimplementedDataStoreServer

type UnimplementedDataStoreServer struct {
}

UnimplementedDataStoreServer must be embedded to have forward compatible implementations.

func (UnimplementedDataStoreServer) DeleteData

func (UnimplementedDataStoreServer) GetData

func (UnimplementedDataStoreServer) SetData

type UnsafeDataStoreServer

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

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

Jump to

Keyboard shortcuts

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