Documentation ¶
Overview ¶
Package api contains the Unix Domain Socket API.
Index ¶
Constants ¶
View Source
const ( TypeNone = iota TypeOK TypeError TypeVPNConfigUpdate TypeUndefined )
Message types.
View Source
const (
// MaxPayloadLength is the maximum allowed length of a message payload.
MaxPayloadLength = 2097152
)
Variables ¶
View Source
var ( // SocketFile is the unix socket file. SocketFile = "/run/oc-daemon/daemon.sock" // SocketOwner is the owner of the socket file. SocketOwner = "" // SocketGroup is the group of the socket file. SocketGroup = "" // SocketPermissions are the file permissions of the socket file. SocketPermissions = "0700" // RequestTimeout is the timeout for an entire request/response // exchange initiated by a client. RequestTimeout = 30 * time.Second )
Functions ¶
Types ¶
type Config ¶ added in v0.1.0
type Config struct { SocketFile string SocketOwner string SocketGroup string SocketPermissions string RequestTimeout time.Duration }
Config is a server configuration.
type Message ¶
Message is an API message.
func NewMessage ¶
NewMessage returns a new message with type t and payload p.
type Request ¶
type Request struct {
// contains filtered or unexported fields
}
Request is a request from a client.
Click to show internal directories.
Click to hide internal directories.