xrpc

package
v2.0.5+incompatible Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2020 License: BSD-2-Clause Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EmbeddedCertsDir     = "test_certs"
	EmbeddedCACert       = "ca.crt"
	EmbeddedCAKey        = "ca.key"
	EmbeddedClientCACert = "ca-client.crt"
	EmbeddedClientCAKey  = "ca-client.key"
	EmbeddedUICACert     = "ca-ui.crt"
	EmbeddedUICAKey      = "ca-ui.key"
	EmbeddedNodeCert     = "node.crt"
	EmbeddedNodeKey      = "node.key"
	EmbeddedRootCert     = "client.root.crt"
	EmbeddedRootKey      = "client.root.key"
	EmbeddedTestUserCert = "client.testuser.crt"
	EmbeddedTestUserKey  = "client.testuser.key"
)

EmbeddedCertsDir is the certs directory inside embedded assets. Embedded*{Cert,Key} are the filenames for embedded certs.

Variables

View Source
var ErrTimePointInFuture = fmt.Errorf("Tm pt in future")
View Source
var NoTicksAvail = fmt.Errorf("no ticks available")
View Source
var OurStdout io.Writer = os.Stdout

so we can multi write easily, use our own printf

View Source
var Verbose bool = false

for tons of debug output

View Source
var VerboseVerbose bool = false

Functions

func FileLine

func FileLine(depth int) string

func LoadClientTLSConfig

func LoadClientTLSConfig(sslCA, sslCert, sslCertKey string) (*tls.Config, error)

LoadClientTLSConfig creates a client TLSConfig by loading the CA and client certs. The following paths must be passed: - sslCA: path to the CA certificate - sslCert: path to the client certificate - sslCertKey: path to the client key If the path is prefixed with "embedded=", load the embedded certs.

func LoadServerTLSConfig

func LoadServerTLSConfig(sslCA, sslClientCA, sslCert, sslCertKey string) (*tls.Config, error)

LoadServerTLSConfig creates a server TLSConfig by loading the CA and server certs. The following paths must be passed:

  • sslCA: path to the CA certificate
  • sslClientCA: path to the CA certificate to verify client certificates, can be the same as sslCA
  • sslCert: path to the server certificate
  • sslCertKey: path to the server key

If the path is prefixed with "embedded=", load the embedded certs.

func P

func P(format string, a ...interface{})

func PB

func PB(w io.Writer, format string, a ...interface{})

func PP

func PP(format string, a ...interface{})

func PPP

func PPP(format string, a ...interface{})

without the file/line, otherwise the same as PP

func Printf

func Printf(format string, a ...interface{}) (n int, err error)

Printf formats according to a format specifier and writes to standard output. It returns the number of bytes written and any write error encountered.

func QPrintf

func QPrintf(format string, a ...interface{}) (n int, err error)

func TSPrintf

func TSPrintf(format string, a ...interface{})

time-stamped printf

func VPrintf

func VPrintf(format string, a ...interface{}) (n int, err error)

quieted for now, uncomment below to display

func VV

func VV(format string, a ...interface{})

func XclientMain

func XclientMain()

Types

type Args

type Args struct {
	A int
	B int
}

type Reply

type Reply struct {
	C   int
	Err error
}

type ServerCallbackMgr

type ServerCallbackMgr struct {
	RpcXsrv *rpcxServer.Server
	// contains filtered or unexported fields
}

func NewRpcXServer

func NewRpcXServer(addr string) *ServerCallbackMgr

addr is like localhost:8972

Jump to

Keyboard shortcuts

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