Documentation
¶
Index ¶
- Constants
- Variables
- func IsValidNodeStatus(s string) bool
- func NewError(base error, extra ...interface{}) error
- func NewInternalError(msg string) error
- func NewInvalidInputError(msg string) error
- func Validate(s interface{}) error
- type ACLBootstrapRequest
- type ACLPolicy
- type ACLPolicyDeleteRequest
- type ACLPolicyListRequest
- type ACLPolicyListResponse
- type ACLPolicyListStub
- type ACLPolicyRule
- type ACLPolicySpecificRequest
- type ACLPolicyUpsertRequest
- type ACLState
- type ACLToken
- type ACLTokenDeleteRequest
- type ACLTokenListRequest
- type ACLTokenListResponse
- type ACLTokenListStub
- type ACLTokenSpecificRequest
- type ACLTokenUpsertRequest
- type ACLTokenUpsertResponse
- type Agent
- type Connection
- func (c *Connection) ConnectedInterfaceIDs() []string
- func (c *Connection) ConnectedNodeIDs() []string
- func (c *Connection) ConnectsInterface(s string) bool
- func (c *Connection) ConnectsInterfaces(a, b string) bool
- func (c *Connection) Merge(in *Connection) *Connection
- func (c *Connection) OtherPeerSettingsByInterfaceID(s string) *PeerSettings
- func (c *Connection) PeerSettingsByInterfaceID(s string) *PeerSettings
- func (c *Connection) PeerSettingsByNodeID(s string) *PeerSettings
- func (c *Connection) Stub() *ConnectionListStub
- func (c *Connection) Validate() error
- type ConnectionDeleteRequest
- type ConnectionListRequest
- type ConnectionListResponse
- type ConnectionListStub
- type ConnectionSpecificRequest
- type ConnectionUpsertRequest
- type Error
- type Filters
- type GenericRequest
- type GenericResponse
- type Interface
- type InterfaceDeleteRequest
- type InterfaceListRequest
- type InterfaceListResponse
- type InterfaceListStub
- type InterfaceSpecificRequest
- type InterfaceUpsertRequest
- type Network
- func (n *Network) CheckAddressInRange(ip string) error
- func (n *Network) Merge(in *Network) *Network
- func (n *Network) RemoveConnection(id string)
- func (n *Network) RemoveInterface(id string)
- func (n *Network) Stub() *NetworkListStub
- func (n *Network) UpsertConnection(id string)
- func (n *Network) UpsertInterface(id string)
- func (n *Network) Validate() error
- type NetworkDeleteRequest
- type NetworkListRequest
- type NetworkListResponse
- type NetworkListStub
- type NetworkSpecificRequest
- type NetworkUpsertRequest
- type Node
- type NodeInterfaceUpdateRequest
- type NodeInterfacesResponse
- type NodeJoinNetworkRequest
- type NodeLeaveNetworkRequest
- type NodeListRequest
- type NodeListResponse
- type NodeListStub
- type NodePreregisterRequest
- type NodePreregisterResponse
- type NodeRegisterRequest
- type NodeSpecificRequest
- type NodeUpdateResponse
- type NodeUpdateStatusRequest
- type Peer
- type PeerSettings
- type QueryOptions
- type ResolveACLTokenRequest
- type ResolveACLTokenResponse
- type Response
- type RoutingRules
- type SingleACLPolicyResponse
- type SingleACLTokenResponse
- type SingleConnectionResponse
- type SingleInterfaceResponse
- type SingleNetworkResponse
- type SingleNodeResponse
- type StatusVersionResponse
- type WriteRequest
Constants ¶
const ( // ACLTokenTypeClient ... ACLTokenTypeClient = "client" // ACLTokenTypeManagement ... ACLTokenTypeManagement = "management" )
const ( NodeStatusInit = "initializing" NodeStatusReady = "ready" NodeStatusDown = "down" )
Variables ¶
var ( // ErrPermissionDenied : ErrPermissionDenied = errors.New(errPermissionDenied) // ErrACLAlreadyBootstrapped ... ErrACLAlreadyBootstrapped = errors.New(errACLAlreadyBootstrapped) // ErrACLDisabled ... ErrACLDisabled = errors.New(errACLDisabled) // ErrInternal ... ErrInternal = errors.New(errInternal) // ErrInvalidInput ... ErrInvalidInput = errors.New(errInvalidInput) // ErrNotFound ... ErrNotFound = errors.New(errNotFound) )
Functions ¶
func IsValidNodeStatus ¶
IsValidNodeStatus returns true if the status passed as argument corresponds to a valid node status. Otherwise returns false.
func NewInternalError ¶
func NewInvalidInputError ¶
Types ¶
type ACLBootstrapRequest ¶
type ACLBootstrapRequest struct {
ResetIndex uint64
WriteRequest
}
ACLBootstrapRequest :
type ACLPolicy ¶
type ACLPolicy struct {
Name string
Description string
Rules []*ACLPolicyRule
CreatedAt time.Time
UpdatedAt time.Time
}
ACLPolicy contains a composition of subpolicies for each resource exposed by Drago. It can be assigned to an ACL Token and, according to the capabilities within each subpolicy, gives different levels of access to these resources.
type ACLPolicyDeleteRequest ¶
type ACLPolicyDeleteRequest struct {
// Name contains the name of the policy to be deleted.
Names []string
WriteRequest
}
ACLPolicyDeleteRequest :
type ACLPolicyListRequest ¶
type ACLPolicyListRequest struct {
QueryOptions
}
ACLPolicyListRequest :
type ACLPolicyListResponse ¶
type ACLPolicyListResponse struct {
Response
// Items contains the policies found.
Items []*ACLPolicyListStub
}
ACLPolicyListResponse :
type ACLPolicyListStub ¶
type ACLPolicyListStub struct {
Name string
Description string
CreatedAt time.Time
UpdatedAt time.Time
}
ACLPolicyListStub :
type ACLPolicyRule ¶
ACLPolicyRule ...
type ACLPolicySpecificRequest ¶
type ACLPolicySpecificRequest struct {
// Name contains the name of the policy to be retrieved.
Name string
QueryOptions
}
ACLPolicySpecificRequest :
type ACLPolicyUpsertRequest ¶
type ACLPolicyUpsertRequest struct {
ACLPolicy *ACLPolicy
WriteRequest
}
ACLPolicyUpsertRequest :
type ACLToken ¶
type ACLToken struct {
ID string
Type string
Name string
Secret string
Policies []string
CreatedAt time.Time
UpdatedAt time.Time
}
ACLToken :
type ACLTokenDeleteRequest ¶
type ACLTokenDeleteRequest struct {
ACLTokenIDs []string
WriteRequest
}
ACLTokenDeleteRequest :
type ACLTokenListResponse ¶
type ACLTokenListResponse struct {
Items []*ACLTokenListStub
Response
}
ACLTokenListResponse :
type ACLTokenListStub ¶
type ACLTokenListStub struct {
ID string
Name string
Type string
Policies []string
CreatedAt time.Time
UpdatedAt time.Time
}
ACLTokenListStub :
type ACLTokenSpecificRequest ¶
type ACLTokenSpecificRequest struct {
ACLTokenID string
QueryOptions
}
ACLTokenSpecificRequest :
type ACLTokenUpsertRequest ¶
type ACLTokenUpsertRequest struct {
ACLToken *ACLToken
WriteRequest
}
ACLTokenUpsertRequest :
type ACLTokenUpsertResponse ¶
ACLTokenUpsertResponse :
type Connection ¶
type Connection struct {
ID string
NetworkID string
// PeerSettings contains the ID and the configurations to be applied
// to each of the connected interfaces.
PeerSettings []*PeerSettings
// If the connection is going from a NAT-ed peer to a public peer,
// the node behind the NAT must regularly send an outgoing ping to
// keep the bidirectional connection alive in the NAT router's
// connection table.
PersistentKeepalive *int
CreatedAt time.Time
UpdatedAt time.Time
}
Connection :
func (*Connection) ConnectedInterfaceIDs ¶
func (c *Connection) ConnectedInterfaceIDs() []string
ConnectedInterfaceIDs :
func (*Connection) ConnectedNodeIDs ¶
func (c *Connection) ConnectedNodeIDs() []string
ConnectedNodeIDs :
func (*Connection) ConnectsInterface ¶
func (c *Connection) ConnectsInterface(s string) bool
ConnectsInterface : checks whether a connection connects an interface whose index is passed as argument.
func (*Connection) ConnectsInterfaces ¶
func (c *Connection) ConnectsInterfaces(a, b string) bool
ConnectsInterfaces : checks whether a Connection connects two interfaces whose indices are passed as arguments.
func (*Connection) OtherPeerSettingsByInterfaceID ¶
func (c *Connection) OtherPeerSettingsByInterfaceID(s string) *PeerSettings
OtherPeerSettingsByInterfaceID : given the ID of one of the connected interfaces, returns the settings for the peer/interface at the other end of the connection.
func (*Connection) PeerSettingsByInterfaceID ¶
func (c *Connection) PeerSettingsByInterfaceID(s string) *PeerSettings
PeerSettingsByInterfaceID :
func (*Connection) PeerSettingsByNodeID ¶
func (c *Connection) PeerSettingsByNodeID(s string) *PeerSettings
PeerSettingsByNodeID :
type ConnectionDeleteRequest ¶
type ConnectionDeleteRequest struct {
ConnectionIDs []string
WriteRequest
}
ConnectionDeleteRequest :
type ConnectionListRequest ¶
type ConnectionListRequest struct {
InterfaceID string
NodeID string
NetworkID string
QueryOptions
}
ConnectionListRequest :
type ConnectionListResponse ¶
type ConnectionListResponse struct {
Items []*ConnectionListStub
Response
}
ConnectionListResponse :
type ConnectionListStub ¶
type ConnectionListStub struct {
ID string
NetworkID string
NodeIDs []string
Peers []string
PeerSettings []*PeerSettings
PersistentKeepalive *int
BytesTransferred uint64
CreatedAt time.Time
UpdatedAt time.Time
}
ConnectionListStub :
type ConnectionSpecificRequest ¶
type ConnectionSpecificRequest struct {
ConnectionID string
QueryOptions
}
ConnectionSpecificRequest :
type ConnectionUpsertRequest ¶
type ConnectionUpsertRequest struct {
Connection *Connection
WriteRequest
}
ConnectionUpsertRequest :
type GenericRequest ¶
type GenericRequest struct {
QueryOptions
}
GenericRequest is used to request where no specific information is needed.
type GenericResponse ¶
type GenericResponse struct {
Response
}
GenericResponse is used to respond to a request where no specific response information is needed.
type Interface ¶
type Interface struct {
ID string
NodeID string
NetworkID string
Name *string
Address *string
ListenPort *int
PublicKey *string
Peers []*Peer
Connections []string
CreatedAt time.Time
UpdatedAt time.Time
// contains filtered or unexported fields
}
func (*Interface) RemoveConnection ¶
RemoveConnection :
func (*Interface) UpsertConnection ¶
UpsertConnection :
type InterfaceDeleteRequest ¶
type InterfaceDeleteRequest struct {
InterfaceIDs []string
WriteRequest
}
InterfaceDeleteRequest :
type InterfaceListRequest ¶
type InterfaceListRequest struct {
NodeID string
NetworkID string
QueryOptions
}
InterfaceListRequest :
type InterfaceListResponse ¶
type InterfaceListResponse struct {
Items []*InterfaceListStub
Response
}
InterfaceListResponse :
type InterfaceListStub ¶
type InterfaceListStub struct {
ID string
NodeID string
NetworkID string
Name *string
Address *string
ListenPort *int
ConnectionsCount int
PublicKey *string
HasPublicKey bool
CreatedAt time.Time
UpdatedAt time.Time
}
InterfaceListStub :
type InterfaceSpecificRequest ¶
type InterfaceSpecificRequest struct {
InterfaceID string
QueryOptions
}
InterfaceSpecificRequest :
type InterfaceUpsertRequest ¶
type InterfaceUpsertRequest struct {
Interface *Interface
WriteRequest
}
InterfaceUpsertRequest :
type Network ¶
type Network struct {
ID string
Name string
AddressRange string
Interfaces []string
Connections []string
CreatedAt time.Time
UpdatedAt time.Time
// contains filtered or unexported fields
}
Network :
func (*Network) CheckAddressInRange ¶
CheckAddressInRange : Check whether an IP address in CIDR notation is within the allowed range of the network.
type NetworkDeleteRequest ¶
type NetworkDeleteRequest struct {
NetworkIDs []string
WriteRequest
}
NetworkDeleteRequest :
type NetworkListResponse ¶
type NetworkListResponse struct {
Items []*NetworkListStub
Response
}
NetworkListResponse :
type NetworkListStub ¶
type NetworkListStub struct {
ID string
Name string
AddressRange string
InterfacesCount int
ConnectionsCount int
CreatedAt time.Time
UpdatedAt time.Time
}
NetworkListStub :
type NetworkSpecificRequest ¶
type NetworkSpecificRequest struct {
NetworkID string
QueryOptions
}
NetworkSpecificRequest :
type NetworkUpsertRequest ¶
type NetworkUpsertRequest struct {
Network *Network
WriteRequest
}
NetworkUpsertRequest :
type Node ¶
type Node struct {
ID string
SecretID string
Name string
AdvertiseAddress string
Status string
Interfaces []string
Connections []string
Meta map[string]string
CreatedAt time.Time
UpdatedAt time.Time
// contains filtered or unexported fields
}
Node :
type NodeInterfaceUpdateRequest ¶
type NodeInterfaceUpdateRequest struct {
NodeID string
Interfaces []*Interface
WriteRequest
}
NodeInterfaceUpdateRequest :
type NodeInterfacesResponse ¶
NodeInterfacesResponse :
type NodeJoinNetworkRequest ¶
type NodeJoinNetworkRequest struct {
NodeID string
NetworkID string
WriteRequest
}
NodeJoinNetworkRequest :
type NodeLeaveNetworkRequest ¶
type NodeLeaveNetworkRequest struct {
NodeID string
NetworkID string
WriteRequest
}
NodeLeaveNetworkRequest :
type NodeListResponse ¶
type NodeListResponse struct {
Items []*NodeListStub
Response
}
NodeListResponse :
type NodeListStub ¶
type NodeListStub struct {
ID string
Name string
AdvertiseAddress string
Status string
InterfacesCount int
ConnectionsCount int
Meta map[string]string
CreatedAt time.Time
UpdatedAt time.Time
}
NodeListStub :
type NodePreregisterRequest ¶
type NodePreregisterRequest struct {
Node *Node
WriteRequest
}
NodePreregisterRequest :
type NodePreregisterResponse ¶
NodePreregisterResponse :
type NodeRegisterRequest ¶
type NodeRegisterRequest struct {
Node *Node
WriteRequest
}
NodeRegisterRequest :
func (*NodeRegisterRequest) Validate ¶
func (r *NodeRegisterRequest) Validate() error
Validate validates a structs.NodeRegisterRequest
type NodeSpecificRequest ¶
type NodeSpecificRequest struct {
NodeID string
SecretID string
QueryOptions
}
NodeSpecificRequest :
type NodeUpdateResponse ¶
NodeUpdateResponse is used to update nodes
type NodeUpdateStatusRequest ¶
type NodeUpdateStatusRequest struct {
NodeID string
Status string
AdvertiseAddress string
Meta map[string]string
WriteRequest
}
NodeUpdateStatusRequest :
type PeerSettings ¶
type PeerSettings struct {
NodeID string
InterfaceID string
RoutingRules *RoutingRules
}
PeerSettings :
type QueryOptions ¶
QueryOptions contains information that is common to all read requests.
type ResolveACLTokenRequest ¶
type ResolveACLTokenRequest struct {
Secret string
QueryOptions
}
ResolveACLTokenRequest :
type ResolveACLTokenResponse ¶
ResolveACLTokenResponse :
type Response ¶
type Response struct {
}
Response contains information that is common to all responses.
type RoutingRules ¶
type RoutingRules struct {
// AllowedIPs defines the IP ranges for which traffic will be routed/accepted.
// Example: If AllowedIPs = [192.0.2.3/32, 192.168.1.1/24], the node
// will accept traffic for itself (192.0.2.3/32), and for all nodes in the
// local network (192.168.1.1/24).
AllowedIPs []string
}
RoutingRules :
type SingleACLPolicyResponse ¶
SingleACLPolicyResponse :
type SingleACLTokenResponse ¶
SingleACLTokenResponse :
type SingleConnectionResponse ¶
type SingleConnectionResponse struct {
Connection *Connection
Response
}
SingleConnectionResponse :
type SingleInterfaceResponse ¶
SingleInterfaceResponse :
type SingleNetworkResponse ¶
SingleNetworkResponse :
type SingleNodeResponse ¶
SingleNodeResponse :
type StatusVersionResponse ¶
type StatusVersionResponse struct {
Version string
QueryOptions
}
StatusVersionResponse ...
type WriteRequest ¶
type WriteRequest struct {
AuthToken string
}
WriteRequest contains information that is common to all write requests.