admin

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2018 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Overview

Package admin is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

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) Descriptor() ([]byte, []int)

func (*File) GetFile

func (m *File) GetFile() string

func (*File) ProtoMessage

func (*File) ProtoMessage()

func (*File) Reset

func (m *File) Reset()

func (*File) String

func (m *File) String() string

func (*File) XXX_DiscardUnknown

func (m *File) XXX_DiscardUnknown()

func (*File) XXX_Marshal

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

func (*File) XXX_Merge

func (m *File) XXX_Merge(src proto.Message)

func (*File) XXX_Size

func (m *File) XXX_Size() int

func (*File) XXX_Unmarshal

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

Jump to

Keyboard shortcuts

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