rpcserver

package
v0.0.0-...-3cf2f40 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2019 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RPC_IP_ADRESS = "127.0.0.1"
	RPC_PORT      = ":14555"
)
View Source
const (
	RPC_START     = "-start"
	RPC_RESTART   = "-restart"
	RPC_STOP      = "-stop"
	RPC_STATUS    = "-status"
	RPC_UPDATE_DB = "-update" //TODO: implement update on demand functionality

	//administrative db operations
	RPC_TRUNCATE_DB    = "-truncatedb"    //TODO: TRUNCATE all tables
	RPC_TRUNCATE_TABLE = "-truncatetable" //TODO: TRUNCATE or DROP a specific table
	RPC_INITIALIZE_DB  = "-initializedb"  //TODO:	CREATE all tables that dont exist yet
	RPC_DESTROY_DB     = "-destroydb"     //TODO: DROP all tables
)

Variables

This section is empty.

Functions

func DecryptKey

func DecryptKey(requestKey []byte) bool

func ErrCheck

func ErrCheck(msg string, err error)

func Run

func Run()

func RunServer

func RunServer(r *RpcServer, Logs *zap.SugaredLogger)

Types

type AccessData

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

type Args

type Args struct {
	Key     []byte
	Name    string
	Message string
	Ctx     map[string]interface{}
}

type Reply

type Reply struct {
	Message   string
	RunCheck  bool
	RPCCheck  bool
	ProcessID int
	Key       []byte
}

func RestartServer

func RestartServer(args Args, res *Reply) *Reply

func StartServer

func StartServer(args Args, res *Reply) *Reply

func Status

func Status(reply *Reply) *Reply

func StopServer

func StopServer(args Args, res *Reply) *Reply

type RpcServer

type RpcServer struct {
	Data *ServerData
}

type Server

type Server struct{}

func (*Server) RpcRequestHandler

func (s *Server) RpcRequestHandler(ctx context.Context, args Args, reply *Reply) error

type ServerData

type ServerData struct {
	ProcessName string
	ProcessID   int
	Log         *zap.SugaredLogger
	Address     string
	Port        *string
	Verifier    *verifier.Config
	Key         string
	Phrase      string

	RpcRunning      bool
	VerifierRunning bool
	// contains filtered or unexported fields
}

func GetKey

func GetKey(s *ServerData) *ServerData

Jump to

Keyboard shortcuts

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