Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrFailedToStart is returned when the daemon process cannot be started ErrFailedToStart = errors.New("daemon could not be started") // ErrVersionMismatch is returned when the daemon process was spawned by a different version than the connecting client ErrVersionMismatch = errors.New("daemon version does not match client version") // ErrTooManyAttempts is returned when the client fails to connect too many times ErrTooManyAttempts = errors.New("reached maximum number of attempts contacting daemon") // ErrDaemonNotRunning is returned when the client cannot contact the daemon and has // been instructed not to attempt to start a new daemon ErrDaemonNotRunning = errors.New("the daemon is not running") )
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { turbodprotocol.TurbodClient *grpc.ClientConn SockPath turbopath.AbsoluteSystemPath PidPath turbopath.AbsoluteSystemPath LogPath turbopath.AbsoluteSystemPath }
Client represents a connection to the daemon process
type ConnectionError ¶
type ConnectionError struct { SockPath turbopath.AbsoluteSystemPath PidPath turbopath.AbsoluteSystemPath LogPath turbopath.AbsoluteSystemPath // contains filtered or unexported fields }
ConnectionError is returned in the error case from connect. It wraps the underlying cause and adds a message with the relevant files for the user to check.
func (*ConnectionError) Error ¶
func (ce *ConnectionError) Error() string
func (*ConnectionError) Unwrap ¶
func (ce *ConnectionError) Unwrap() error
Unwrap allows a connection error to work with standard library "errors" and compatible packages
type Connector ¶
type Connector struct { Logger hclog.Logger Bin string Opts Opts SockPath turbopath.AbsoluteSystemPath PidPath turbopath.AbsoluteSystemPath LogPath turbopath.AbsoluteSystemPath TurboVersion string }
Connector instances are used to create a connection to turbo's daemon process The daemon will be started , or killed and restarted, if necessary
type Opts ¶
type Opts struct { ServerTimeout time.Duration DontStart bool // if true, don't attempt to start the daemon DontKill bool // if true, don't attempt to kill the daemon }
Opts is the set of configurable options for the client connection, including some options to be passed through to the daemon process if it needs to be started.
Click to show internal directories.
Click to hide internal directories.