Documentation
¶
Index ¶
- type Client
- type Dataset
- type DirsConf
- type Postgres
- func (p *Postgres) GetClientConf(clientID string) (conf *sts.ClientConf, err error)
- func (p *Postgres) GetClientStatus(clientID, clientName, clientOS string) (status sts.ClientStatus, err error)
- func (p *Postgres) IsValid(source, clientID string) bool
- func (p *Postgres) SetClientConfReceived(clientID string, when time.Time) error
- func (p *Postgres) SetClientState(clientID string, state sts.ClientState) error
- type SourceConf
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { ID string `db:"id"` Key string `db:"upload_key"` Name string `db:"name"` Alias string `db:"alias"` OS string `db:"os"` DirsConf *DirsConf `db:"dirs_conf"` State *sts.ClientState `db:"state"` CreatedAt time.Time `db:"created_at"` UpdatedAt time.Time `db:"updated_at"` VerifiedAt pq.NullTime `db:"verified_at"` PingedAt pq.NullTime `db:"pinged_at"` LoadedAt pq.NullTime `db:"loaded_at"` }
Client represents a client record
type Dataset ¶
type Dataset struct { Name string `db:"name"` SourceConf *SourceConf `db:"source_conf"` ClientID sql.NullString `db:"client_id"` CreatedAt time.Time `db:"created_at"` UpdatedAt time.Time `db:"updated_at"` }
Dataset represents a dataset record
type DirsConf ¶
type DirsConf struct {
sts.ClientDirs
}
DirsConf wraps the sts.ClientDirs type
type Postgres ¶
type Postgres struct {
// contains filtered or unexported fields
}
Postgres fulfills the sts.ClientManager interface
func NewPostgres ¶
func NewPostgres( port uint, host, name, user, pass, clientsTable, datasetsTable string, idDecoder sts.DecodeClientID, ) (p *Postgres)
NewPostgres creates a new Postgres instance
func (*Postgres) GetClientConf ¶
func (p *Postgres) GetClientConf(clientID string) (conf *sts.ClientConf, err error)
GetClientConf helps fulfill the sts.ClientManager interface
func (*Postgres) GetClientStatus ¶
func (p *Postgres) GetClientStatus( clientID, clientName, clientOS string, ) (status sts.ClientStatus, err error)
GetClientStatus helps fulfill the sts.ClientManager interface
func (*Postgres) IsValid ¶
IsValid fulfills sts.IsKeyValid and determines whether or not the input key (client ID) is allowed to send a file that looks like the input file struct
func (*Postgres) SetClientConfReceived ¶
SetClientConfReceived helps fulfill the sts.ClientManager interface
func (*Postgres) SetClientState ¶
func (p *Postgres) SetClientState(clientID string, state sts.ClientState) error
SetClientState helps fulfill the sts.ClientManager interface
type SourceConf ¶
type SourceConf struct {
sts.SourceConf
}
SourceConf wraps the sts.SourceConf type
func (*SourceConf) Scan ¶
func (c *SourceConf) Scan(src interface{}) error
Scan transforms the database type to our internal type