Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Image ¶
type Instance ¶
type Instance struct {
ID int `jsonapi:"primary,instances"`
Hostname string `jsonapi:"attr,hostname"`
ImageID int `jsonapi:"attr,image_id"`
UserEmail string
RefreshToken string
CreatedAt time.Time `jsonapi:"attr,created_at,iso8601"`
UpdatedAt time.Time `jsonapi:"attr,updated_at,iso8601"`
Port uint16 `jsonapi:"attr,port"`
Credentials *InstanceCredentials `jsonapi:"relation,credentials"`
}
func NewInstance ¶
type InstanceCredentials ¶
type InstanceCredentials struct {
// The JSON:API spec says that we should have an ID field, even though we'll
// just be setting it to the same value as the instance ID.
// It would be nice to have this struct as an embedded object, rather than a relation, but that's not possible due to these issues:
// https://github.com/google/jsonapi/issues/74
// https://github.com/google/jsonapi/issues/117
ID int `jsonapi:"primary,credentials"`
CACertificate string `jsonapi:"attr,ca_certificate"`
ClientCertificate string `jsonapi:"attr,client_certificate"`
ClientKey string `jsonapi:"attr,client_key"`
}
func NewInstanceCredentials ¶
func NewInstanceCredentials(id int, caCert string, clientCert string, clientKey string) InstanceCredentials
type WhitelistedAddress ¶
type WhitelistedAddress struct {
// Given that we're not serving this model via JSON:API, we don't need a
// surrogate key (e.g. 'ID'). The IP address and instance ID are used as a composite key.
IPAddress string
Instance *Instance
CreatedAt time.Time
UpdatedAt time.Time
}
func NewWhitelistedAddress ¶
func NewWhitelistedAddress(ipaddress string, instance *Instance) WhitelistedAddress
Click to show internal directories.
Click to hide internal directories.