Documentation
¶
Index ¶
- type DataStore
- func (ds *DataStore) Client() *mongo.Client
- func (ds *DataStore) Db() *mongo.Database
- func (ds *DataStore) DeleteClient(clientId string) (int64, error)
- func (ds *DataStore) DeleteField(collectionName string, id string) error
- func (ds *DataStore) DeleteFields(collection *mongo.Collection, fields *[]structs.Field) error
- func (ds *DataStore) DeleteJob(jobId string) (int64, error)
- func (ds *DataStore) GetAllJobs() ([]structs.Job, error)
- func (ds *DataStore) GetClientForMachine() (*structs.Client, error)
- func (ds *DataStore) GetClients() ([]structs.Client, error)
- func (ds *DataStore) GetFields(collectionName string) ([]structs.Field, error)
- func (ds *DataStore) GetJobsForClient(client structs.Client) ([]structs.Job, error)
- func (ds *DataStore) GetNextJobForClient(client *structs.Client) (*structs.Job, error)
- func (ds *DataStore) InsertFields(collection *mongo.Collection, fields *[]structs.Field) error
- func (ds *DataStore) LoadSharedConfig() error
- func (ds *DataStore) ModifyClient(client *structs.Client, mode string) error
- func (ds *DataStore) ModifyJob(job *structs.Job, clientID primitive.ObjectID, mode string) error
- func (ds *DataStore) SignInClient(client *structs.Client) error
- func (ds *DataStore) SignOutClient(client *structs.Client) error
- func (ds *DataStore) SignOutThisClient() error
- func (ds *DataStore) UpdateFields(collectionName string, fields *[]structs.Field) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DataStore ¶
type DataStore struct {
// contains filtered or unexported fields
}
func (*DataStore) DeleteField ¶
func (*DataStore) DeleteFields ¶
DeleteFields deletes fields from the database
Params:
collection is the database collection to delete structs.Field structs from
fields is the structs.Field slice containing all Fields that should be deleted
func (*DataStore) GetAllJobs ¶
GetJAllJobs gets all jobs
nil will be returned if there are no jobs available
func (*DataStore) GetClientForMachine ¶
GetClientForMachine returns the current db client that matches this machine's hostname. A new client will be created if none is found in the database
func (*DataStore) GetClients ¶
GetClients retrieves all clients that have been registered
func (*DataStore) GetJobsForClient ¶
GetJobsForClient gets all jobs for a given client
nil will be returned if there are no jobs available for the client
func (*DataStore) GetNextJobForClient ¶
GetNextJobForClient returns the next available job in the queue for a given client
nil will be returned if there are no more jobs available
func (*DataStore) InsertFields ¶
func (*DataStore) LoadSharedConfig ¶
func (*DataStore) ModifyClient ¶
func (*DataStore) SignInClient ¶
Signs out the current machine
func (*DataStore) SignOutClient ¶
Signs out the current machine