graphd

package
v0.0.0-...-e994e88 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TCP_SCHEME  = "tcp"
	UNIX_SCHEME = "unix"
)

Supported URL schemes over which to connect.

View Source
const (
	DEFAULT_URL_SCHEME = TCP_SCHEME
	DEFAULT_URL_HOST   = "127.0.0.1"
	DEFAULT_URL_PORT   = "8100"
	DEFAULT_URL_STR    = DEFAULT_URL_SCHEME + "://" + DEFAULT_URL_HOST + ":" + DEFAULT_URL_PORT
)

Default URL to which to connect.

Variables

This section is empty.

Functions

func New

func New(l Logger, logLevel syslog.Priority, urlStrs []string) *graphd

New returns a populated graphdb struct pointer. l can be used to specify one's own logger (must implement Print). A nil Logger interface argument will default to using syslog. logLevel is used to control which log messages are emitted. urlStrs is a list of URLs to which to try to connect.

Types

type Logger

type Logger interface {
	Print(v ...interface{})
}

Allows use of any datatype which implements Print, as a logger (ie. a log.Logger tied to syslog, or to os.Stderr/Stdout).

type Request

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

A Request to be sent to a graphd database. Currently this is just a wrapper around a string.

func NewRequest

func NewRequest(s string) *Request

NewRequest returns a Request pointer initialized from the string parameter. The parameter should represent one request to be sent to a graphd database. A new line is automatically added.

func (*Request) String

func (r *Request) String() string

String implements stringer interface for a Request.

type Response

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

A Response received from a graphd database. Currently this is just a wrapper around a string.

func NewResponse

func NewResponse(s string) *Response

NewResponse returns a Response pointer initialized from the string parameter. The parameter should represent one response received from a graphd database.

func (*Response) String

func (r *Response) String() string

String implements stringer interface for a Response.

Directories

Path Synopsis
package fakegraphd implements a server used for testing graphd clients.
package fakegraphd implements a server used for testing graphd clients.

Jump to

Keyboard shortcuts

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