Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DaemonConnectionStruct ¶
type DaemonConnectionStruct struct {
Connection net.Conn
config.BobbitConfig
}
DaemonConnectionStruct holds the network connection and configuration for a Bobbit daemon client.
func New ¶
func New(c config.BobbitConfig) *DaemonConnectionStruct
New creates and returns a new DaemonConnectionStruct initialized with the provided BobbitConfig.
func (*DaemonConnectionStruct) BuildPayload ¶
func (d *DaemonConnectionStruct) BuildPayload(p *payload.JobPayload, metadata any) (err error)
BuildPayload establishes a connection to the daemon's Unix socket and marshals the provided metadata into the JobPayload. It returns an error if the connection fails or metadata marshalling fails.
func (*DaemonConnectionStruct) GetPayload ¶
func (d *DaemonConnectionStruct) GetPayload(target any) error
GetPayload decodes the response from the daemon connection into the provided target object. It returns an error if decoding fails.
func (*DaemonConnectionStruct) SendPayload ¶
func (d *DaemonConnectionStruct) SendPayload(target any) error
SendPayload encodes and sends the given target object over the established daemon connection. It returns an error if encoding or writing fails.
type DaemonNotRunningError ¶
type DaemonNotRunningError struct {
NetError error
Config config.BobbitConfig
}
func (*DaemonNotRunningError) Error ¶
func (d *DaemonNotRunningError) Error() string