documentpb

package
v0.0.2-alpha Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2018 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package documentpb is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterDocumentServiceHandler

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

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

func RegisterDocumentServiceHandlerClient

func RegisterDocumentServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client DocumentServiceClient) error

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

func RegisterDocumentServiceHandlerFromEndpoint

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

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

func RegisterDocumentServiceServer

func RegisterDocumentServiceServer(s *grpc.Server, srv DocumentServiceServer)

Types

type CreateDocumentProofForVersionRequest

type CreateDocumentProofForVersionRequest struct {
	Identifier           string   `protobuf:"bytes,1,opt,name=identifier,proto3" json:"identifier,omitempty"`
	Type                 string   `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"`
	Version              string   `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"`
	Fields               []string `protobuf:"bytes,4,rep,name=fields,proto3" json:"fields,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*CreateDocumentProofForVersionRequest) Descriptor

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

func (*CreateDocumentProofForVersionRequest) GetFields

func (*CreateDocumentProofForVersionRequest) GetIdentifier

func (m *CreateDocumentProofForVersionRequest) GetIdentifier() string

func (*CreateDocumentProofForVersionRequest) GetType

func (*CreateDocumentProofForVersionRequest) GetVersion

func (*CreateDocumentProofForVersionRequest) ProtoMessage

func (*CreateDocumentProofForVersionRequest) ProtoMessage()

func (*CreateDocumentProofForVersionRequest) Reset

func (*CreateDocumentProofForVersionRequest) String

func (*CreateDocumentProofForVersionRequest) XXX_DiscardUnknown

func (m *CreateDocumentProofForVersionRequest) XXX_DiscardUnknown()

func (*CreateDocumentProofForVersionRequest) XXX_Marshal

func (m *CreateDocumentProofForVersionRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*CreateDocumentProofForVersionRequest) XXX_Merge

func (*CreateDocumentProofForVersionRequest) XXX_Size

func (*CreateDocumentProofForVersionRequest) XXX_Unmarshal

func (m *CreateDocumentProofForVersionRequest) XXX_Unmarshal(b []byte) error

type CreateDocumentProofRequest

type CreateDocumentProofRequest struct {
	Identifier           string   `protobuf:"bytes,1,opt,name=identifier,proto3" json:"identifier,omitempty"`
	Type                 string   `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"`
	Fields               []string `protobuf:"bytes,3,rep,name=fields,proto3" json:"fields,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*CreateDocumentProofRequest) Descriptor

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

func (*CreateDocumentProofRequest) GetFields

func (m *CreateDocumentProofRequest) GetFields() []string

func (*CreateDocumentProofRequest) GetIdentifier

func (m *CreateDocumentProofRequest) GetIdentifier() string

func (*CreateDocumentProofRequest) GetType

func (m *CreateDocumentProofRequest) GetType() string

func (*CreateDocumentProofRequest) ProtoMessage

func (*CreateDocumentProofRequest) ProtoMessage()

func (*CreateDocumentProofRequest) Reset

func (m *CreateDocumentProofRequest) Reset()

func (*CreateDocumentProofRequest) String

func (m *CreateDocumentProofRequest) String() string

func (*CreateDocumentProofRequest) XXX_DiscardUnknown

func (m *CreateDocumentProofRequest) XXX_DiscardUnknown()

func (*CreateDocumentProofRequest) XXX_Marshal

func (m *CreateDocumentProofRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*CreateDocumentProofRequest) XXX_Merge

func (dst *CreateDocumentProofRequest) XXX_Merge(src proto.Message)

func (*CreateDocumentProofRequest) XXX_Size

func (m *CreateDocumentProofRequest) XXX_Size() int

func (*CreateDocumentProofRequest) XXX_Unmarshal

func (m *CreateDocumentProofRequest) XXX_Unmarshal(b []byte) error

type DocumentProof

type DocumentProof struct {
	Header               *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"`
	FieldProofs          []*Proof        `protobuf:"bytes,2,rep,name=field_proofs,json=fieldProofs,proto3" json:"field_proofs,omitempty"`
	XXX_NoUnkeyedLiteral struct{}        `json:"-"`
	XXX_unrecognized     []byte          `json:"-"`
	XXX_sizecache        int32           `json:"-"`
}

func (*DocumentProof) Descriptor

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

func (*DocumentProof) GetFieldProofs

func (m *DocumentProof) GetFieldProofs() []*Proof

func (*DocumentProof) GetHeader

func (m *DocumentProof) GetHeader() *ResponseHeader

func (*DocumentProof) ProtoMessage

func (*DocumentProof) ProtoMessage()

func (*DocumentProof) Reset

func (m *DocumentProof) Reset()

func (*DocumentProof) String

func (m *DocumentProof) String() string

func (*DocumentProof) XXX_DiscardUnknown

func (m *DocumentProof) XXX_DiscardUnknown()

func (*DocumentProof) XXX_Marshal

func (m *DocumentProof) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*DocumentProof) XXX_Merge

func (dst *DocumentProof) XXX_Merge(src proto.Message)

func (*DocumentProof) XXX_Size

func (m *DocumentProof) XXX_Size() int

func (*DocumentProof) XXX_Unmarshal

func (m *DocumentProof) XXX_Unmarshal(b []byte) error

type DocumentServiceClient

type DocumentServiceClient interface {
	CreateDocumentProof(ctx context.Context, in *CreateDocumentProofRequest, opts ...grpc.CallOption) (*DocumentProof, error)
	CreateDocumentProofForVersion(ctx context.Context, in *CreateDocumentProofForVersionRequest, opts ...grpc.CallOption) (*DocumentProof, error)
}

DocumentServiceClient is the client API for DocumentService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewDocumentServiceClient

func NewDocumentServiceClient(cc *grpc.ClientConn) DocumentServiceClient

type DocumentServiceServer

type DocumentServiceServer interface {
	CreateDocumentProof(context.Context, *CreateDocumentProofRequest) (*DocumentProof, error)
	CreateDocumentProofForVersion(context.Context, *CreateDocumentProofForVersionRequest) (*DocumentProof, error)
}

DocumentServiceServer is the server API for DocumentService service.

type Proof

type Proof struct {
	Property string `protobuf:"bytes,1,opt,name=property,proto3" json:"property,omitempty"`
	Value    string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
	Salt     string `protobuf:"bytes,3,opt,name=salt,proto3" json:"salt,omitempty"`
	// hash is filled if value & salt are not available
	Hash                 string   `protobuf:"bytes,4,opt,name=hash,proto3" json:"hash,omitempty"`
	SortedHashes         []string `protobuf:"bytes,5,rep,name=sorted_hashes,json=sortedHashes,proto3" json:"sorted_hashes,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Proof) Descriptor

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

func (*Proof) GetHash

func (m *Proof) GetHash() string

func (*Proof) GetProperty

func (m *Proof) GetProperty() string

func (*Proof) GetSalt

func (m *Proof) GetSalt() string

func (*Proof) GetSortedHashes

func (m *Proof) GetSortedHashes() []string

func (*Proof) GetValue

func (m *Proof) GetValue() string

func (*Proof) ProtoMessage

func (*Proof) ProtoMessage()

func (*Proof) Reset

func (m *Proof) Reset()

func (*Proof) String

func (m *Proof) String() string

func (*Proof) XXX_DiscardUnknown

func (m *Proof) XXX_DiscardUnknown()

func (*Proof) XXX_Marshal

func (m *Proof) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Proof) XXX_Merge

func (dst *Proof) XXX_Merge(src proto.Message)

func (*Proof) XXX_Size

func (m *Proof) XXX_Size() int

func (*Proof) XXX_Unmarshal

func (m *Proof) XXX_Unmarshal(b []byte) error

type ResponseHeader

type ResponseHeader struct {
	DocumentId           string   `protobuf:"bytes,1,opt,name=document_id,json=documentId,proto3" json:"document_id,omitempty"`
	VersionId            string   `protobuf:"bytes,2,opt,name=version_id,json=versionId,proto3" json:"version_id,omitempty"`
	State                string   `protobuf:"bytes,3,opt,name=state,proto3" json:"state,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

ResponseHeader contains a set of common fields for most documents

func (*ResponseHeader) Descriptor

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

func (*ResponseHeader) GetDocumentId

func (m *ResponseHeader) GetDocumentId() string

func (*ResponseHeader) GetState

func (m *ResponseHeader) GetState() string

func (*ResponseHeader) GetVersionId

func (m *ResponseHeader) GetVersionId() string

func (*ResponseHeader) ProtoMessage

func (*ResponseHeader) ProtoMessage()

func (*ResponseHeader) Reset

func (m *ResponseHeader) Reset()

func (*ResponseHeader) String

func (m *ResponseHeader) String() string

func (*ResponseHeader) XXX_DiscardUnknown

func (m *ResponseHeader) XXX_DiscardUnknown()

func (*ResponseHeader) XXX_Marshal

func (m *ResponseHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ResponseHeader) XXX_Merge

func (dst *ResponseHeader) XXX_Merge(src proto.Message)

func (*ResponseHeader) XXX_Size

func (m *ResponseHeader) XXX_Size() int

func (*ResponseHeader) XXX_Unmarshal

func (m *ResponseHeader) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

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