Documentation
¶
Index ¶
- func ListModels() []interface{}
- type Egress
- func (e *Egress) Count(ctx context.Context) (int, error)
- func (e *Egress) Create(ctx context.Context) error
- func (e *Egress) Delete(ctx context.Context) error
- func (e *Egress) DoesEgressRouteExists(ctx context.Context) error
- func (e *Egress) Get(ctx context.Context) error
- func (e *Egress) ListByNetwork(ctx context.Context) (egs []Egress, err error)
- func (e *Egress) ResetDomain(ctx context.Context) error
- func (e *Egress) ResetRange(ctx context.Context) error
- func (e *Egress) Table() string
- func (e *Egress) Update(ctx context.Context) error
- func (e *Egress) UpdateEgressStatus(ctx context.Context) error
- func (e *Egress) UpdateNatStatus(ctx context.Context) error
- type Event
- func (a *Event) Create(ctx context.Context) error
- func (a *Event) DeleteOldEvents(ctx context.Context, retentionDays int) error
- func (a *Event) Get(ctx context.Context) error
- func (a *Event) List(ctx context.Context, from, to time.Time) (ats []Event, err error)
- func (a *Event) ListByNetwork(ctx context.Context, from, to time.Time) (ats []Event, err error)
- func (a *Event) ListByUser(ctx context.Context, from, to time.Time) (ats []Event, err error)
- func (a *Event) ListByUserAndNetwork(ctx context.Context, from, to time.Time) (ats []Event, err error)
- func (a *Event) Update(ctx context.Context) error
- type Job
- type Nameserver
- func (ns *Nameserver) Create(ctx context.Context) error
- func (ns *Nameserver) Delete(ctx context.Context) error
- func (ns *Nameserver) Get(ctx context.Context) error
- func (ns *Nameserver) ListByNetwork(ctx context.Context) (dnsli []Nameserver, err error)
- func (ns *Nameserver) Update(ctx context.Context) error
- func (ns *Nameserver) UpdateMatchAll(ctx context.Context) error
- func (ns *Nameserver) UpdateStatus(ctx context.Context) error
- type NameserverDomain
- type PendingHost
- func (p *PendingHost) CheckIfPendingHostExists(ctx context.Context) error
- func (p *PendingHost) Create(ctx context.Context) error
- func (p *PendingHost) Delete(ctx context.Context) error
- func (p *PendingHost) DeleteAllPendingHosts(ctx context.Context) error
- func (p *PendingHost) Get(ctx context.Context) error
- func (p *PendingHost) List(ctx context.Context) (pendingHosts []PendingHost, err error)
- type UserAccessToken
- func (a *UserAccessToken) CountByUser(ctx context.Context) (int, error)
- func (a *UserAccessToken) Create(ctx context.Context) error
- func (a *UserAccessToken) Delete(ctx context.Context) error
- func (a *UserAccessToken) DeleteAllUserTokens(ctx context.Context) error
- func (a *UserAccessToken) Get(ctx context.Context) error
- func (a *UserAccessToken) List(ctx context.Context) (ats []UserAccessToken, err error)
- func (a *UserAccessToken) ListByUser(ctx context.Context) (ats []UserAccessToken)
- func (a *UserAccessToken) Update(ctx context.Context) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Egress ¶
type Egress struct {
ID string `gorm:"primaryKey" json:"id"`
Name string `gorm:"name" json:"name"`
Network string `gorm:"network" json:"network"`
Description string `gorm:"description" json:"description"`
Nodes datatypes.JSONMap `gorm:"nodes" json:"nodes"`
Tags datatypes.JSONMap `gorm:"tags" json:"tags"`
Range string `gorm:"range" json:"range"`
DomainAns datatypes.JSONSlice[string] `gorm:"domain_ans" json:"domain_ans"`
Domain string `gorm:"domain" json:"domain"`
Nat bool `gorm:"nat" json:"nat"`
//IsInetGw bool `gorm:"is_inet_gw" json:"is_internet_gateway"`
Status bool `gorm:"status" json:"status"`
CreatedBy string `gorm:"created_by" json:"created_by"`
CreatedAt time.Time `gorm:"created_at" json:"created_at"`
UpdatedAt time.Time `gorm:"updated_at" json:"updated_at"`
}
func (*Egress) DoesEgressRouteExists ¶ added in v1.1.0
func (*Egress) ListByNetwork ¶
func (*Egress) ResetDomain ¶ added in v1.2.0
type Event ¶
type Event struct {
ID string `gorm:"primaryKey" json:"id"`
Action models.Action `gorm:"action" json:"action"`
Source datatypes.JSON `gorm:"source" json:"source"`
Origin models.Origin `gorm:"origin" json:"origin"`
Target datatypes.JSON `gorm:"target" json:"target"`
NetworkID models.NetworkID `gorm:"network_id" json:"network_id"`
TriggeredBy string `gorm:"triggered_by" json:"triggered_by"`
Diff datatypes.JSON `gorm:"diff" json:"diff"`
TimeStamp time.Time `gorm:"time_stamp" json:"time_stamp"`
}
func (*Event) DeleteOldEvents ¶
func (*Event) ListByNetwork ¶
func (*Event) ListByUser ¶
func (*Event) ListByUserAndNetwork ¶
type Job ¶
Job represents a task that netmaker server wants to do.
Ideally, a jobs table should have details about its type, status, who initiated it, etc. But, for now, the table only contains records of jobs that have been done, so that it is easier to prevent a task from being executed again.
type Nameserver ¶ added in v1.1.0
type Nameserver struct {
ID string `gorm:"primaryKey" json:"id"`
Name string `gorm:"name" json:"name"`
NetworkID string `gorm:"network_id" json:"network_id"`
Description string `gorm:"description" json:"description"`
Servers datatypes.JSONSlice[string] `gorm:"servers" json:"servers"`
MatchAll bool `gorm:"match_all" json:"match_all"`
Domains datatypes.JSONSlice[NameserverDomain] `gorm:"domains" json:"domains"`
// TODO: deprecate
MatchDomains datatypes.JSONSlice[string] `gorm:"match_domains" json:"match_domains"`
Tags datatypes.JSONMap `gorm:"tags" json:"tags"`
Nodes datatypes.JSONMap `gorm:"nodes" json:"nodes"`
Status bool `gorm:"status" json:"status"`
CreatedBy string `gorm:"created_by" json:"created_by"`
CreatedAt time.Time `gorm:"created_at" json:"created_at"`
UpdatedAt time.Time `gorm:"updated_at" json:"updated_at"`
}
func (*Nameserver) ListByNetwork ¶ added in v1.1.0
func (ns *Nameserver) ListByNetwork(ctx context.Context) (dnsli []Nameserver, err error)
func (*Nameserver) UpdateMatchAll ¶ added in v1.1.0
func (ns *Nameserver) UpdateMatchAll(ctx context.Context) error
func (*Nameserver) UpdateStatus ¶ added in v1.1.0
func (ns *Nameserver) UpdateStatus(ctx context.Context) error
type NameserverDomain ¶ added in v1.2.0
type PendingHost ¶ added in v1.1.0
type PendingHost struct {
ID string `gorm:"id" json:"id"`
HostID string `gorm:"host_id" json:"host_id"`
Hostname string `gorm:"host_name" json:"host_name"`
Network string `gorm:"network" json:"network"`
PublicKey string `gorm:"public_key" json:"public_key"`
EnrollmentKey datatypes.JSON `gorm:"enrollment_key_id" json:"enrollment_key_id"`
OS string `gorm:"os" json:"os"`
Version string `gorm:"version" json:"version"`
Location string `gorm:"location" json:"location"` // Format: "lat,lon"
RequestedAt time.Time `gorm:"requested_at" json:"requested_at"`
}
func (*PendingHost) CheckIfPendingHostExists ¶ added in v1.1.0
func (p *PendingHost) CheckIfPendingHostExists(ctx context.Context) error
func (*PendingHost) Create ¶ added in v1.1.0
func (p *PendingHost) Create(ctx context.Context) error
func (*PendingHost) Delete ¶ added in v1.1.0
func (p *PendingHost) Delete(ctx context.Context) error
func (*PendingHost) DeleteAllPendingHosts ¶ added in v1.1.0
func (p *PendingHost) DeleteAllPendingHosts(ctx context.Context) error
func (*PendingHost) List ¶ added in v1.1.0
func (p *PendingHost) List(ctx context.Context) (pendingHosts []PendingHost, err error)
type UserAccessToken ¶
type UserAccessToken struct {
ID string `gorm:"primaryKey" json:"id"`
Name string `json:"name"`
UserName string `json:"user_name"`
ExpiresAt time.Time `json:"expires_at"`
LastUsed time.Time `json:"last_used"`
CreatedBy string `json:"created_by"`
CreatedAt time.Time `json:"created_at"`
}
UserAccessToken - token used to access netmaker
func (*UserAccessToken) CountByUser ¶ added in v1.0.0
func (a *UserAccessToken) CountByUser(ctx context.Context) (int, error)
func (*UserAccessToken) DeleteAllUserTokens ¶
func (a *UserAccessToken) DeleteAllUserTokens(ctx context.Context) error
func (*UserAccessToken) List ¶
func (a *UserAccessToken) List(ctx context.Context) (ats []UserAccessToken, err error)
func (*UserAccessToken) ListByUser ¶
func (a *UserAccessToken) ListByUser(ctx context.Context) (ats []UserAccessToken)
Click to show internal directories.
Click to hide internal directories.