Documentation
¶
Overview ¶
Package admin is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- func RegisterAdminManagerHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterAdminManagerHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AdminManagerClient) error
- func RegisterAdminManagerHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterAdminManagerServer(s *grpc.Server, srv AdminManagerServer)
- type AdminManagerClient
- type AdminManagerServer
- type File
- func (*File) Descriptor() ([]byte, []int)
- func (m *File) GetFile() string
- func (*File) ProtoMessage()
- func (m *File) Reset()
- func (m *File) String() string
- func (m *File) XXX_DiscardUnknown()
- func (m *File) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *File) XXX_Merge(src proto.Message)
- func (m *File) XXX_Size() int
- func (m *File) XXX_Unmarshal(b []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterAdminManagerHandler ¶
func RegisterAdminManagerHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterAdminManagerHandler registers the http handlers for service AdminManager to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterAdminManagerHandlerClient ¶
func RegisterAdminManagerHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AdminManagerClient) error
RegisterAdminManagerHandlerClient registers the http handlers for service AdminManager to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "AdminManagerClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "AdminManagerClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "AdminManagerClient" to call the correct interceptors.
func RegisterAdminManagerHandlerFromEndpoint ¶
func RegisterAdminManagerHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterAdminManagerHandlerFromEndpoint is same as RegisterAdminManagerHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterAdminManagerServer ¶
func RegisterAdminManagerServer(s *grpc.Server, srv AdminManagerServer)
Types ¶
type AdminManagerClient ¶
type AdminManagerClient interface {
// ChainManager is the collection of Cpchain full node-related APIs
// exposed over the private admin endpoint.
ExportChain(ctx context.Context, in *File, opts ...grpc.CallOption) (*common.IsOk, error)
// ImportChain imports a blockchain from a local file.
ImportChain(ctx context.Context, in *File, opts ...grpc.CallOption) (*common.IsOk, error)
}
AdminManagerClient is the client API for AdminManager service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewAdminManagerClient ¶
func NewAdminManagerClient(cc *grpc.ClientConn) AdminManagerClient
type AdminManagerServer ¶
type AdminManagerServer interface {
// ChainManager is the collection of Cpchain full node-related APIs
// exposed over the private admin endpoint.
ExportChain(context.Context, *File) (*common.IsOk, error)
// ImportChain imports a blockchain from a local file.
ImportChain(context.Context, *File) (*common.IsOk, error)
}
AdminManagerServer is the server API for AdminManager service.
type File ¶
type File struct {
// file to import or export
File string `protobuf:"bytes,1,opt,name=file,proto3" json:"file,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (*File) Descriptor ¶
func (*File) ProtoMessage ¶
func (*File) ProtoMessage()
func (*File) XXX_DiscardUnknown ¶
func (m *File) XXX_DiscardUnknown()