Documentation ¶
Index ¶
- Variables
- type Controller
- func (c *Controller) CreateHost(ctx context.Context, in *CreateHostInput) (*domain.Host, error)
- func (c *Controller) CreateInterface(ctx context.Context, in *CreateInterfaceInput) (*domain.Interface, error)
- func (c *Controller) CreateLink(ctx context.Context, in *CreateLinkInput) (*domain.Link, error)
- func (c *Controller) CreateNetwork(ctx context.Context, in *CreateNetworkInput) (*domain.Network, error)
- func (c *Controller) CreateToken(ctx context.Context, in *CreateTokenInput) (*domain.Token, error)
- func (c *Controller) DeleteHost(ctx context.Context, in *DeleteHostInput) (*domain.Host, error)
- func (c *Controller) DeleteInterface(ctx context.Context, in *DeleteInterfaceInput) (*domain.Interface, error)
- func (c *Controller) DeleteLink(ctx context.Context, in *DeleteLinkInput) (*domain.Link, error)
- func (c *Controller) DeleteNetwork(ctx context.Context, in *DeleteNetworkInput) (*domain.Network, error)
- func (c *Controller) GetHost(ctx context.Context, in *GetHostInput) (*domain.Host, error)
- func (c *Controller) GetHostSettings(ctx context.Context, in *GetHostSettingsInput) (*domain.HostSettings, error)
- func (c *Controller) GetInterface(ctx context.Context, in *GetInterfaceInput) (*domain.Interface, error)
- func (c *Controller) GetLink(ctx context.Context, in *GetLinkInput) (*domain.Link, error)
- func (c *Controller) GetNetwork(ctx context.Context, in *GetNetworkInput) (*domain.Network, error)
- func (c *Controller) GetSelfToken(ctx context.Context, in *GetSelfTokenInput) (*domain.Token, error)
- func (c *Controller) ListHosts(ctx context.Context, in *ListHostsInput) (*pagination.Page, error)
- func (c *Controller) ListInterfaces(ctx context.Context, in *ListInterfacesInput) (*pagination.Page, error)
- func (c *Controller) ListLinks(ctx context.Context, in *ListLinksInput) (*pagination.Page, error)
- func (c *Controller) ListNetworks(ctx context.Context, in *ListNetworksInput) (*pagination.Page, error)
- func (c *Controller) SynchronizeHost(ctx context.Context, in *SynchronizeHostInput) (*domain.HostSettings, error)
- func (c *Controller) UpdateHost(ctx context.Context, in *UpdateHostInput) (*domain.Host, error)
- func (c *Controller) UpdateHostState(ctx context.Context, in *UpdateHostStateInput) (*domain.HostState, error)
- func (c *Controller) UpdateInterface(ctx context.Context, in *UpdateInterfaceInput) (*domain.Interface, error)
- func (c *Controller) UpdateLink(ctx context.Context, in *UpdateLinkInput) (*domain.Link, error)
- func (c *Controller) UpdateNetwork(ctx context.Context, in *UpdateNetworkInput) (*domain.Network, error)
- type CreateHostInput
- type CreateHostWithIDInput
- type CreateInterfaceInput
- type CreateLinkInput
- type CreateNetworkInput
- type CreateTokenInput
- type DeleteHostInput
- type DeleteInterfaceInput
- type DeleteLinkInput
- type DeleteNetworkInput
- type DeleteTokenInput
- type GetHostInput
- type GetHostSettingsInput
- type GetInterfaceInput
- type GetLinkInput
- type GetNetworkInput
- type GetSelfTokenInput
- type GetTokenInput
- type ListHostsInput
- type ListInterfacesInput
- type ListLinksInput
- type ListNetworksInput
- type ListTokensInput
- type SynchronizeHostInput
- type UpdateHostInput
- type UpdateHostStateInput
- type UpdateInterfaceInput
- type UpdateLinkInput
- type UpdateNetworkInput
Constants ¶
This section is empty.
Variables ¶
var ( // Invalid input error ErrInvalidInput = errors.New("Invalid input") // Internal error ErrInternal = errors.New("Internal error") // Not implemented error ErrNotImplemented = errors.New("Not implemented") ErrUnauthorized = errors.New("Not authorized") // Not found error ErrNotFound = errors.New("Resource not found") )
Functions ¶
This section is empty.
Types ¶
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
Controller :
func New ¶
func New(ns application.NetworkService, hs application.HostService, is application.InterfaceService, ls application.LinkService, ss application.SynchronizationService, ts application.TokenService) (*Controller, error)
New :
func (*Controller) CreateHost ¶
func (c *Controller) CreateHost(ctx context.Context, in *CreateHostInput) (*domain.Host, error)
CreateHost :
func (*Controller) CreateInterface ¶
func (c *Controller) CreateInterface(ctx context.Context, in *CreateInterfaceInput) (*domain.Interface, error)
CreateInterface :
func (*Controller) CreateLink ¶
func (c *Controller) CreateLink(ctx context.Context, in *CreateLinkInput) (*domain.Link, error)
CreateLink :
func (*Controller) CreateNetwork ¶
func (c *Controller) CreateNetwork(ctx context.Context, in *CreateNetworkInput) (*domain.Network, error)
CreateNetwork :
func (*Controller) CreateToken ¶
func (c *Controller) CreateToken(ctx context.Context, in *CreateTokenInput) (*domain.Token, error)
CreateToken :
func (*Controller) DeleteHost ¶
func (c *Controller) DeleteHost(ctx context.Context, in *DeleteHostInput) (*domain.Host, error)
DeleteHost :
func (*Controller) DeleteInterface ¶
func (c *Controller) DeleteInterface(ctx context.Context, in *DeleteInterfaceInput) (*domain.Interface, error)
DeleteInterface :
func (*Controller) DeleteLink ¶
func (c *Controller) DeleteLink(ctx context.Context, in *DeleteLinkInput) (*domain.Link, error)
DeleteLink :
func (*Controller) DeleteNetwork ¶
func (c *Controller) DeleteNetwork(ctx context.Context, in *DeleteNetworkInput) (*domain.Network, error)
DeleteNetwork :
func (*Controller) GetHost ¶
func (c *Controller) GetHost(ctx context.Context, in *GetHostInput) (*domain.Host, error)
GetHost :
func (*Controller) GetHostSettings ¶
func (c *Controller) GetHostSettings(ctx context.Context, in *GetHostSettingsInput) (*domain.HostSettings, error)
GetHostSettingsByID :
func (*Controller) GetInterface ¶
func (c *Controller) GetInterface(ctx context.Context, in *GetInterfaceInput) (*domain.Interface, error)
GetInterface :
func (*Controller) GetLink ¶
func (c *Controller) GetLink(ctx context.Context, in *GetLinkInput) (*domain.Link, error)
GetLink :
func (*Controller) GetNetwork ¶
func (c *Controller) GetNetwork(ctx context.Context, in *GetNetworkInput) (*domain.Network, error)
GetNetwork :
func (*Controller) GetSelfToken ¶
func (c *Controller) GetSelfToken(ctx context.Context, in *GetSelfTokenInput) (*domain.Token, error)
GetSelfToken :
func (*Controller) ListHosts ¶
func (c *Controller) ListHosts(ctx context.Context, in *ListHostsInput) (*pagination.Page, error)
ListHosts :
func (*Controller) ListInterfaces ¶
func (c *Controller) ListInterfaces(ctx context.Context, in *ListInterfacesInput) (*pagination.Page, error)
ListInterfaces :
func (*Controller) ListLinks ¶
func (c *Controller) ListLinks(ctx context.Context, in *ListLinksInput) (*pagination.Page, error)
ListLinks :
func (*Controller) ListNetworks ¶
func (c *Controller) ListNetworks(ctx context.Context, in *ListNetworksInput) (*pagination.Page, error)
ListNetworks :
func (*Controller) SynchronizeHost ¶
func (c *Controller) SynchronizeHost(ctx context.Context, in *SynchronizeHostInput) (*domain.HostSettings, error)
SynchronizeHost :
func (*Controller) UpdateHost ¶
func (c *Controller) UpdateHost(ctx context.Context, in *UpdateHostInput) (*domain.Host, error)
UpdateHost :
func (*Controller) UpdateHostState ¶
func (c *Controller) UpdateHostState(ctx context.Context, in *UpdateHostStateInput) (*domain.HostState, error)
UpdateHostState :
func (*Controller) UpdateInterface ¶
func (c *Controller) UpdateInterface(ctx context.Context, in *UpdateInterfaceInput) (*domain.Interface, error)
UpdateInterface :
func (*Controller) UpdateLink ¶
func (c *Controller) UpdateLink(ctx context.Context, in *UpdateLinkInput) (*domain.Link, error)
UpdateLink :
func (*Controller) UpdateNetwork ¶
func (c *Controller) UpdateNetwork(ctx context.Context, in *UpdateNetworkInput) (*domain.Network, error)
UpdateNetwork :
type CreateHostInput ¶
type CreateHostInput struct { Name *string `json:"name" validate:"required,min=1,max=50"` AdvertiseAddress *string `json:"advertiseAddress" validate:"omitempty,ip_addr|fqdn"` Labels []string `json:"labels" validate:"dive,omitempty,dashedalphanum"` }
CreateHostInput :
type CreateHostWithIDInput ¶
type CreateHostWithIDInput struct { ID *string `json:"id" validate:"required,uuid4"` Name *string `json:"name" validate:"omitempty,min=1,max=50"` }
CreateHostWithIDInput :
type CreateInterfaceInput ¶
type CreateInterfaceInput struct { Name *string `json:"name" validate:"required,min=1,max=50"` HostID *string `json:"hostId" validate:"required,uuid4"` NetworkID *string `json:"networkId" validate:"omitempty,uuid4"` IPAddress *string `json:"ipAddress" validate:"omitempty,cidr"` ListenPort *string `json:"listenPort" validate:"omitempty,numeric,min=1,max=5"` PublicKey *string `json:"publicKey" validate:""` Table *string `json:"table" validate:""` DNS *string `json:"dns" validate:""` MTU *string `json:"mtu" validate:""` PreUp *string `json:"preUp" validate:""` PostUp *string `json:"postUp" validate:""` PreDown *string `json:"preDown" validate:""` PostDown *string `json:"postDown" validate:""` }
CreateInterfaceInput :
type CreateLinkInput ¶
type CreateLinkInput struct { FromInterfaceID *string `json:"fromInterfaceId" validate:"required,uuid4"` ToInterfaceID *string `json:"toInterfaceId" validate:"required,uuid4"` AllowedIPs []string `json:"allowedIPs" validate:"dive,omitempty,cidr"` PersistentKeepalive *int `json:"persistentKeepalive" validate:"omitempty,numeric"` }
CreateLinkInput :
type CreateNetworkInput ¶
type CreateNetworkInput struct { Name *string `json:"name" validate:"required,min=1,max=50"` IPAddressRange *string `json:"ipAddressRange" validate:"required,cidr"` }
CreateNetworkInput :
type CreateTokenInput ¶
type CreateTokenInput struct { Type *string `json:"type" validate:"required,oneof='client' 'management'"` Subject *string `json:"subject" validate:"required"` Labels []string `json:"labels" validate:"dive,omitempty,min=1,max=64"` }
CreateTokenInput :
type DeleteHostInput ¶
type DeleteHostInput struct {
ID string `validate:"required,uuid4"`
}
DeleteHostInput :
type DeleteInterfaceInput ¶
type DeleteInterfaceInput struct {
ID string `validate:"required,uuid4"`
}
DeleteInterfaceInput :
type DeleteLinkInput ¶
type DeleteLinkInput struct {
ID string `validate:"required,uuid4"`
}
DeleteLinkInput :
type DeleteNetworkInput ¶
type DeleteNetworkInput struct {
ID string `validate:"required,uuid4"`
}
DeleteNetworkInput :
type DeleteTokenInput ¶
type DeleteTokenInput struct {
ID string `validate:"required,uuid4"`
}
DeleteTokenInput :
type GetHostInput ¶
type GetHostInput struct {
ID string `validate:"required,uuid4"`
}
GetHostInput :
type GetHostSettingsInput ¶
type GetHostSettingsInput struct {
ID string `validate:"required,uuid4"`
}
GetHostSettingsInput :
type GetInterfaceInput ¶
type GetInterfaceInput struct {
ID string `validate:"required,uuid4"`
}
GetInterfaceInput :
type GetLinkInput ¶
type GetLinkInput struct {
ID string `validate:"required,uuid4"`
}
GetLinkInput :
type GetNetworkInput ¶
type GetNetworkInput struct {
ID string `validate:"required,uuid4"`
}
GetNetworkInput :
type GetSelfTokenInput ¶
type GetSelfTokenInput struct {
Raw *string `json:"type" validate:"required"`
}
GetSelfTokenInput :
type GetTokenInput ¶
type GetTokenInput struct {
ID *string `json:"type" validate:"required,uuid4"`
}
GetTokenInput :
type ListHostsInput ¶
type ListHostsInput struct { pagination.Input LabelFilters []string `query:"label" validate:"omitempty"` NetworkIDFilter string `query:"networkId" validate:"omitempty,uuid4"` }
ListHostsInput :
type ListInterfacesInput ¶
type ListInterfacesInput struct { pagination.Input HostIDFilter string `query:"hostId" validate:"omitempty,uuid4"` NetworkIDFilter string `query:"networkId" validate:"omitempty,uuid4"` }
ListInterfacesInput :
type ListLinksInput ¶
type ListLinksInput struct { pagination.Input NetworkIDFilter string `query:"networkId" validate:"omitempty,uuid4"` SourceHostIDFilter string `query:"fromHostId" validate:"omitempty,uuid4"` SourceInterfaceIDFilter string `query:"fromInterfaceId" validate:"omitempty,uuid4"` }
ListLinksInput :
type ListTokensInput ¶
type ListTokensInput struct { pagination.Input NetworkIDFilter string `query:"networkId" validate:"omitempty,uuid4"` }
ListTokensInput :
type SynchronizeHostInput ¶
type SynchronizeHostInput struct { ID string `validate:"required,uuid4"` Interfaces []*struct { Name *string `json:"name" validate:"required"` PublicKey *string `json:"publicKey" validate:"required"` } `json:"interfaces"` Peers []*struct { LatencyMs uint64 `json:"latencyMs,omitempty"` LastHandshake time.Time `json:"lastHandshake,omitempty"` } `json:"peers"` }
SynchronizeHostInput :
type UpdateHostInput ¶
type UpdateHostInput struct { ID *string `json:"id" validate:"required,uuid4"` Name *string `json:"name" validate:"omitempty,min=1,max=50"` AdvertiseAddress *string `json:"advertiseAddress" validate:"omitempty,ip_addr|fqdn"` Labels []string `json:"labels" validate:"dive,omitempty,dashedalphanum"` }
UpdateHostInput :
type UpdateHostStateInput ¶
type UpdateHostStateInput struct { ID string `validate:"required,uuid4"` Interfaces []*struct { Name *string `json:"name" validate:"required"` PublicKey *string `json:"publicKey" validate:"required"` } `json:"interfaces"` Peers []*struct { LatencyMs uint64 `json:"latencyMs,omitempty"` LastHandshake time.Time `json:"lastHandshake,omitempty"` } `json:"peers"` }
UpdateHostStateInput :
type UpdateInterfaceInput ¶
type UpdateInterfaceInput struct { ID *string `json:"id" validate:"required,uuid4"` NetworkID *string `json:"networkId" validate:"omitempty,uuid4"` Name *string `json:"name" validate:"min=1,max=50"` IPAddress *string `json:"ipAddress" validate:"omitempty,cidr"` ListenPort *string `json:"listenPort" validate:"omitempty,numeric,min=1,max=5"` PublicKey *string `json:"publicKey" validate:""` Table *string `json:"table" validate:""` DNS *string `json:"dns" validate:""` MTU *string `json:"mtu" validate:""` PreUp *string `json:"preUp" validate:""` PostUp *string `json:"postUp" validate:""` PreDown *string `json:"preDown" validate:""` PostDown *string `json:"postDown" validate:""` }
UpdateInterfaceInput :
type UpdateLinkInput ¶
type UpdateLinkInput struct { ID *string `json:"id" validate:"required,uuid4"` AllowedIPs []string `json:"allowedIPs" validate:"dive,omitempty,cidr"` PersistentKeepalive *int `json:"persistentKeepalive"` }
UpdateLinkInput :
type UpdateNetworkInput ¶
type UpdateNetworkInput struct { ID *string `json:"id" validate:"required,uuid4"` Name *string `json:"name" validate:"omitempty,min=1,max=50"` IPAddressRange *string `json:"ipAddressRange" validate:"omitempty,cidr"` }
UpdateNetworkInput :