Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteHost ¶
func DeleteHost(ctx context.Context, client Client, req DeleteHostRequest) error
DeleteHost deletes a Defined.net host.
Types ¶
type Client ¶
type Client interface {
Do(ctx context.Context, method string, path []string, request, response any) error
}
Client is a Defined.net HTTP API client.
type ConfigOverride ¶ added in v0.1.3
ConfigOverride is a data model for Defined.net host configuration override.
type CreateEnrollmentRequest ¶
type CreateEnrollmentRequest struct { NetworkID string `json:"networkID"` RoleID string `json:"roleID,omitempty"` Name string `json:"name"` StaticAddresses []string `json:"staticAddresses"` ListenPort int `json:"listenPort"` IsLighthouse bool `json:"isLighthouse"` IsRelay bool `json:"isRelay"` Tags []string `json:"tags"` ConfigOverrides []ConfigOverride `json:"configOverrides"` }
CreateEnrollmentRequest is a request data model for CreateEnrollment endpoint.
type DeleteHostRequest ¶
type DeleteHostRequest struct {
ID string
}
DeleteHostRequest is a request data model for DeleteHost endpoint.
type Enrollment ¶
type Enrollment struct { Host Host `json:"host"` EnrollmentCode EnrollmentCode `json:"enrollmentCode"` }
Enrollment is a data model for Defined.net host enrollment.
func CreateEnrollment ¶
func CreateEnrollment(ctx context.Context, client Client, req CreateEnrollmentRequest) (*Enrollment, error)
CreateEnrollment creates a Defined.net host enrollment.
type EnrollmentCode ¶
type EnrollmentCode struct { Code string `json:"code"` LifetimeSeconds int `json:"lifetimeSeconds"` }
EnrollmentCode is a data model for Defined.net host enrollment code.
type GetHostRequest ¶
type GetHostRequest struct {
ID string
}
GetHostRequest is a request data model for GetHost endpoint.
type Host ¶
type Host struct { ID string `json:"id"` NetworkID string `json:"networkID"` RoleID string `json:"roleID,omitempty"` Name string `json:"name"` IPAddress string `json:"ipAddress"` StaticAddresses []string `json:"staticAddresses"` ListenPort int `json:"listenPort"` IsLighthouse bool `json:"isLighthouse"` IsRelay bool `json:"isRelay"` Tags []string `json:"tags"` ConfigOverrides []ConfigOverride `json:"configOverrides"` }
Host is a data model for Defined.net host.
func UpdateHost ¶
UpdateHost updates a Defined.net host.
type Response ¶
type Response[D any] struct { Data D `json:"data"` }
Response is a generic data model for Defined.net responses.
type UpdateHostRequest ¶
type UpdateHostRequest struct { ID string `json:"-"` RoleID string `json:"roleID,omitempty"` Name string `json:"name"` StaticAddresses []string `json:"staticAddresses"` ListenPort int `json:"listenPort"` Tags []string `json:"tags"` ConfigOverrides []ConfigOverride `json:"configOverrides"` }
UpdateHostRequest is a request data model for UpdateHost endpoint.