apicore

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2022 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package apicore is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var File_rpccore_apicore_apicore_proto protoreflect.FileDescriptor
View Source
var PoetCoreProver_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "apicore.PoetCoreProver",
	HandlerType: (*PoetCoreProverServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Compute",
			Handler:    _PoetCoreProver_Compute_Handler,
		},
		{
			MethodName: "GetNIP",
			Handler:    _PoetCoreProver_GetNIP_Handler,
		},
		{
			MethodName: "Shutdown",
			Handler:    _PoetCoreProver_Shutdown_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "rpccore/apicore/apicore.proto",
}

PoetCoreProver_ServiceDesc is the grpc.ServiceDesc for PoetCoreProver 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 PoetVerifier_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "apicore.PoetVerifier",
	HandlerType: (*PoetVerifierServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "VerifyNIP",
			Handler:    _PoetVerifier_VerifyNIP_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "rpccore/apicore/apicore.proto",
}

PoetVerifier_ServiceDesc is the grpc.ServiceDesc for PoetVerifier service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterPoetCoreProverHandler

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

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

func RegisterPoetCoreProverHandlerClient

func RegisterPoetCoreProverHandlerClient(ctx context.Context, mux *runtime.ServeMux, client PoetCoreProverClient) error

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

func RegisterPoetCoreProverHandlerFromEndpoint

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

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

func RegisterPoetCoreProverHandlerServer

func RegisterPoetCoreProverHandlerServer(ctx context.Context, mux *runtime.ServeMux, server PoetCoreProverServer) error

RegisterPoetCoreProverHandlerServer registers the http handlers for service PoetCoreProver to "mux". UnaryRPC :call PoetCoreProverServer 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 RegisterPoetCoreProverHandlerFromEndpoint instead.

func RegisterPoetCoreProverServer

func RegisterPoetCoreProverServer(s grpc.ServiceRegistrar, srv PoetCoreProverServer)

func RegisterPoetVerifierHandler

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

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

func RegisterPoetVerifierHandlerClient

func RegisterPoetVerifierHandlerClient(ctx context.Context, mux *runtime.ServeMux, client PoetVerifierClient) error

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

func RegisterPoetVerifierHandlerFromEndpoint

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

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

func RegisterPoetVerifierHandlerServer

func RegisterPoetVerifierHandlerServer(ctx context.Context, mux *runtime.ServeMux, server PoetVerifierServer) error

RegisterPoetVerifierHandlerServer registers the http handlers for service PoetVerifier to "mux". UnaryRPC :call PoetVerifierServer 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 RegisterPoetVerifierHandlerFromEndpoint instead.

func RegisterPoetVerifierServer

func RegisterPoetVerifierServer(s grpc.ServiceRegistrar, srv PoetVerifierServer)

Types

type ComputeRequest

type ComputeRequest struct {
	D *DagParams `protobuf:"bytes,1,opt,name=d,proto3" json:"d,omitempty"`
	// contains filtered or unexported fields
}

func (*ComputeRequest) Descriptor deprecated

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

Deprecated: Use ComputeRequest.ProtoReflect.Descriptor instead.

func (*ComputeRequest) GetD

func (x *ComputeRequest) GetD() *DagParams

func (*ComputeRequest) ProtoMessage

func (*ComputeRequest) ProtoMessage()

func (*ComputeRequest) ProtoReflect

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

func (*ComputeRequest) Reset

func (x *ComputeRequest) Reset()

func (*ComputeRequest) String

func (x *ComputeRequest) String() string

type ComputeResponse

type ComputeResponse struct {
	Phi []byte `protobuf:"bytes,1,opt,name=phi,proto3" json:"phi,omitempty"`
	// contains filtered or unexported fields
}

func (*ComputeResponse) Descriptor deprecated

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

Deprecated: Use ComputeResponse.ProtoReflect.Descriptor instead.

func (*ComputeResponse) GetPhi

func (x *ComputeResponse) GetPhi() []byte

func (*ComputeResponse) ProtoMessage

func (*ComputeResponse) ProtoMessage()

func (*ComputeResponse) ProtoReflect

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

func (*ComputeResponse) Reset

func (x *ComputeResponse) Reset()

func (*ComputeResponse) String

func (x *ComputeResponse) String() string

type DagParams

type DagParams struct {
	X []byte `protobuf:"bytes,1,opt,name=x,proto3" json:"x,omitempty"`
	N uint32 `protobuf:"varint,2,opt,name=n,proto3" json:"n,omitempty"`
	// contains filtered or unexported fields
}

func (*DagParams) Descriptor deprecated

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

Deprecated: Use DagParams.ProtoReflect.Descriptor instead.

func (*DagParams) GetN

func (x *DagParams) GetN() uint32

func (*DagParams) GetX

func (x *DagParams) GetX() []byte

func (*DagParams) ProtoMessage

func (*DagParams) ProtoMessage()

func (*DagParams) ProtoReflect

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

func (*DagParams) Reset

func (x *DagParams) Reset()

func (*DagParams) String

func (x *DagParams) String() string

type GetNIPRequest

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

func (*GetNIPRequest) Descriptor deprecated

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

Deprecated: Use GetNIPRequest.ProtoReflect.Descriptor instead.

func (*GetNIPRequest) ProtoMessage

func (*GetNIPRequest) ProtoMessage()

func (*GetNIPRequest) ProtoReflect

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

func (*GetNIPRequest) Reset

func (x *GetNIPRequest) Reset()

func (*GetNIPRequest) String

func (x *GetNIPRequest) String() string

type GetNIPResponse

type GetNIPResponse struct {
	Proof *Proof `protobuf:"bytes,1,opt,name=proof,proto3" json:"proof,omitempty"`
	// contains filtered or unexported fields
}

func (*GetNIPResponse) Descriptor deprecated

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

Deprecated: Use GetNIPResponse.ProtoReflect.Descriptor instead.

func (*GetNIPResponse) GetProof

func (x *GetNIPResponse) GetProof() *Proof

func (*GetNIPResponse) ProtoMessage

func (*GetNIPResponse) ProtoMessage()

func (*GetNIPResponse) ProtoReflect

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

func (*GetNIPResponse) Reset

func (x *GetNIPResponse) Reset()

func (*GetNIPResponse) String

func (x *GetNIPResponse) String() string

type PoetCoreProverClient

type PoetCoreProverClient interface {
	Compute(ctx context.Context, in *ComputeRequest, opts ...grpc.CallOption) (*ComputeResponse, error)
	GetNIP(ctx context.Context, in *GetNIPRequest, opts ...grpc.CallOption) (*GetNIPResponse, error)
	Shutdown(ctx context.Context, in *ShutdownRequest, opts ...grpc.CallOption) (*ShutdownResponse, error)
}

PoetCoreProverClient is the client API for PoetCoreProver 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.

type PoetCoreProverServer

type PoetCoreProverServer interface {
	Compute(context.Context, *ComputeRequest) (*ComputeResponse, error)
	GetNIP(context.Context, *GetNIPRequest) (*GetNIPResponse, error)
	Shutdown(context.Context, *ShutdownRequest) (*ShutdownResponse, error)
}

PoetCoreProverServer is the server API for PoetCoreProver service. All implementations should embed UnimplementedPoetCoreProverServer for forward compatibility

type PoetVerifierClient

type PoetVerifierClient interface {
	VerifyNIP(ctx context.Context, in *VerifyNIPRequest, opts ...grpc.CallOption) (*VerifyNIPResponse, error)
}

PoetVerifierClient is the client API for PoetVerifier 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.

type PoetVerifierServer

type PoetVerifierServer interface {
	VerifyNIP(context.Context, *VerifyNIPRequest) (*VerifyNIPResponse, error)
}

PoetVerifierServer is the server API for PoetVerifier service. All implementations should embed UnimplementedPoetVerifierServer for forward compatibility

type Proof

type Proof struct {
	Phi          []byte   `protobuf:"bytes,1,opt,name=phi,proto3" json:"phi,omitempty"`
	ProvenLeaves [][]byte `protobuf:"bytes,2,rep,name=provenLeaves,json=proven_leaves,proto3" json:"provenLeaves,omitempty"`
	ProofNodes   [][]byte `protobuf:"bytes,3,rep,name=proofNodes,json=proof_nodes,proto3" json:"proofNodes,omitempty"`
	// contains filtered or unexported fields
}

func (*Proof) Descriptor deprecated

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

Deprecated: Use Proof.ProtoReflect.Descriptor instead.

func (*Proof) GetPhi

func (x *Proof) GetPhi() []byte

func (*Proof) GetProofNodes

func (x *Proof) GetProofNodes() [][]byte

func (*Proof) GetProvenLeaves

func (x *Proof) GetProvenLeaves() [][]byte

func (*Proof) ProtoMessage

func (*Proof) ProtoMessage()

func (*Proof) ProtoReflect

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

func (*Proof) Reset

func (x *Proof) Reset()

func (*Proof) String

func (x *Proof) String() string

type ShutdownRequest

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

func (*ShutdownRequest) Descriptor deprecated

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

Deprecated: Use ShutdownRequest.ProtoReflect.Descriptor instead.

func (*ShutdownRequest) ProtoMessage

func (*ShutdownRequest) ProtoMessage()

func (*ShutdownRequest) ProtoReflect

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

func (*ShutdownRequest) Reset

func (x *ShutdownRequest) Reset()

func (*ShutdownRequest) String

func (x *ShutdownRequest) String() string

type ShutdownResponse

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

func (*ShutdownResponse) Descriptor deprecated

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

Deprecated: Use ShutdownResponse.ProtoReflect.Descriptor instead.

func (*ShutdownResponse) ProtoMessage

func (*ShutdownResponse) ProtoMessage()

func (*ShutdownResponse) ProtoReflect

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

func (*ShutdownResponse) Reset

func (x *ShutdownResponse) Reset()

func (*ShutdownResponse) String

func (x *ShutdownResponse) String() string

type UnimplementedPoetCoreProverServer

type UnimplementedPoetCoreProverServer struct {
}

UnimplementedPoetCoreProverServer should be embedded to have forward compatible implementations.

func (UnimplementedPoetCoreProverServer) Compute

func (UnimplementedPoetCoreProverServer) GetNIP

func (UnimplementedPoetCoreProverServer) Shutdown

type UnimplementedPoetVerifierServer

type UnimplementedPoetVerifierServer struct {
}

UnimplementedPoetVerifierServer should be embedded to have forward compatible implementations.

func (UnimplementedPoetVerifierServer) VerifyNIP

type UnsafePoetCoreProverServer

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

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

type UnsafePoetVerifierServer

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

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

type VerifyNIPRequest

type VerifyNIPRequest struct {
	D *DagParams `protobuf:"bytes,1,opt,name=d,proto3" json:"d,omitempty"`
	P *Proof     `protobuf:"bytes,2,opt,name=p,proto3" json:"p,omitempty"`
	// contains filtered or unexported fields
}

func (*VerifyNIPRequest) Descriptor deprecated

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

Deprecated: Use VerifyNIPRequest.ProtoReflect.Descriptor instead.

func (*VerifyNIPRequest) GetD

func (x *VerifyNIPRequest) GetD() *DagParams

func (*VerifyNIPRequest) GetP

func (x *VerifyNIPRequest) GetP() *Proof

func (*VerifyNIPRequest) ProtoMessage

func (*VerifyNIPRequest) ProtoMessage()

func (*VerifyNIPRequest) ProtoReflect

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

func (*VerifyNIPRequest) Reset

func (x *VerifyNIPRequest) Reset()

func (*VerifyNIPRequest) String

func (x *VerifyNIPRequest) String() string

type VerifyNIPResponse

type VerifyNIPResponse struct {
	Verified bool `protobuf:"varint,1,opt,name=verified,proto3" json:"verified,omitempty"`
	// contains filtered or unexported fields
}

func (*VerifyNIPResponse) Descriptor deprecated

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

Deprecated: Use VerifyNIPResponse.ProtoReflect.Descriptor instead.

func (*VerifyNIPResponse) GetVerified

func (x *VerifyNIPResponse) GetVerified() bool

func (*VerifyNIPResponse) ProtoMessage

func (*VerifyNIPResponse) ProtoMessage()

func (*VerifyNIPResponse) ProtoReflect

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

func (*VerifyNIPResponse) Reset

func (x *VerifyNIPResponse) Reset()

func (*VerifyNIPResponse) String

func (x *VerifyNIPResponse) String() string

Jump to

Keyboard shortcuts

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