Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrAPINotEnabled = errors.New("api not enabled") ErrInvalidAuthHeader = errors.New("invalid auth header") ErrInvalidAPIKey = errors.New("invalid api key") ErrInvalidSerialCount = errors.New("invalid serial count") )
API errors
Functions ¶
func SubmitHandler ¶
SubmitHandler returns an http.Handler for submitHandler
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache is a cache id lookup by MD5 hash
type Context ¶
Context is a set of services accessed by endpoints
func (*Context) HandleQueryLastUser ¶ added in v1.3.0
HandleQueryLastUser returns the latest information for the submitted serials
type DB ¶
DB represents a database
func NewDB ¶
NewDB creates a new DB with the given driver and dsn as used by database/sql's Open. workers specifies how many worker goroutines will be used
func (*DB) QueryLastUser ¶ added in v1.3.0
QueryLastUser returns the last information for serials
type Entry ¶
type Entry struct {
UID uint32 `json:"uid,omitempty"`
Username string `json:"username"`
FullName string `json:"full_name"`
Serial string `json:"serial"`
ClientIdentifier string `json:"client_identifier,omitempty"`
Hostname string `json:"hostname,omitempty"`
IP string `json:"ip"`
InternetIP string `json:"internet_ip,omitempty"`
Time time.Time `json:"time,omitempty"`
}
Entry represents information about a computer
type Insert ¶
type Insert struct {
*User
*Device
*Address
*Identity
*LogEntry
UserHash Hash
DeviceHash Hash
AddressHash Hash
IdentityHash Hash
UserID int
DeviceID int
AddressID int
IdentityID int
}
Insert represents a Decomposed Entry. If a field of Insert is nil, it already is in the database
type ValidationError ¶
type ValidationError string
ValidationError represents a field that is too long
func (ValidationError) Error ¶
func (v ValidationError) Error() string
Click to show internal directories.
Click to hide internal directories.