wzlib_database_worker

package
v0.0.0-...-2af49ae Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type WzWorkerClientKeysAPI

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

///////////////////////////////////////////////////// Client keys

func NewWzWorkerClientKeysAPI

func NewWzWorkerClientKeysAPI() *WzWorkerClientKeysAPI

func (*WzWorkerClientKeysAPI) GetRSAPubkeyByFQDN

func (wdb *WzWorkerClientKeysAPI) GetRSAPubkeyByFQDN(fqdn string)

GetRSAPubkeyByFQDN returns client's RSA public key in PEM format, queried by the FQDN.

func (*WzWorkerClientKeysAPI) GetRSAPubkeyByFp

func (wdb *WzWorkerClientKeysAPI) GetRSAPubkeyByFp(fp string)

GetRSAPubkeyByFp returns client's RSA public key in PEM format, queried by the key fingerprint.

func (*WzWorkerClientKeysAPI) GetRSAPubkeyByMachineId

func (wdb *WzWorkerClientKeysAPI) GetRSAPubkeyByMachineId(uid string)

GetRSAPubkeyByMachineId returns client's RSA public key in PEM format, queried by the machine ID.

type WzWorkerClientsAPI

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

///////////////////////////////////////////////////// Clients

func NewWzWorkerClientsAPI

func NewWzWorkerClientsAPI() *WzWorkerClientsAPI

func (*WzWorkerClientsAPI) GetAssignedClients

func (wca *WzWorkerClientsAPI) GetAssignedClients()

GetAssignedClients returns a slice of assigned client systems to the current worker. If there is only one worker, then it will get all of the client systems at once.

func (*WzWorkerClientsAPI) GetClientByFQDN

func (wca *WzWorkerClientsAPI) GetClientByFQDN(fqdn string)

GetClientByFQDN returns client data and its traits by FQDN

func (*WzWorkerClientsAPI) GetClientByFp

func (wca *WzWorkerClientsAPI) GetClientByFp(fp string)

GetClientByFf returns client data and its traits by RSA fingerprint

func (*WzWorkerClientsAPI) GetClientByMachineId

func (wca *WzWorkerClientsAPI) GetClientByMachineId(uid string)

///////////////////////////////////////////////////// Query clients

type WzWorkerDbh

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

func NewWzWorkerDbh

func NewWzWorkerDbh() *WzWorkerDbh

func (*WzWorkerDbh) GetClientsAPI

func (wdb *WzWorkerDbh) GetClientsAPI() *WzWorkerClientsAPI

func (*WzWorkerDbh) GetJobsAPI

func (wdb *WzWorkerDbh) GetJobsAPI() *WzWorkerJobAPI

func (*WzWorkerDbh) GetKeysAPI

func (wdb *WzWorkerDbh) GetKeysAPI() *WzWorkerClientKeysAPI

func (*WzWorkerDbh) SetDbh

func (wdb *WzWorkerDbh) SetDbh(dbh *gorm.DB)

Pass GORM database handler reference to the clients API

type WzWorkerJobAPI

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

///////////////////////////////////////////////////// Job

func NewWorkerJobAPI

func NewWorkerJobAPI() *WzWorkerJobAPI

func (*WzWorkerJobAPI) Delete

func (wdb *WzWorkerJobAPI) Delete(jid string)

func (*WzWorkerJobAPI) FlushAfter

func (wdb *WzWorkerJobAPI) FlushAfter(point *time.Time)

func (*WzWorkerJobAPI) Get

func (wdb *WzWorkerJobAPI) Get(jid string)

func (*WzWorkerJobAPI) GetAllByClient

func (wdb *WzWorkerJobAPI) GetAllByClient(client string, till *time.Time)

GetAllByClient returns all jobs, known in the log by the client

func (*WzWorkerJobAPI) GetFailed

func (wdb *WzWorkerJobAPI) GetFailed(client string)

func (*WzWorkerJobAPI) GetUnfinished

func (wdb *WzWorkerJobAPI) GetUnfinished(client string)

func (*WzWorkerJobAPI) New

func (wdb *WzWorkerJobAPI) New(client string)

func (*WzWorkerJobAPI) Update

func (wdb *WzWorkerJobAPI) Update(jid string)

Jump to

Keyboard shortcuts

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