netbird

package module
v1.3.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 24, 2024 License: Apache-2.0 Imports: 6 Imported by: 1

README

Contributors Forks Stargazers Issues Apache 2.0 License Release Latest Tag CI


Logo

netbird-go

netbird-go is a Go library for configuring Netbird.


About The Project

Features

Getting Started

✔️ Prerequisites

🎯 Installation

🧪 Testing

💡 Usage

📖 Examples

🐞 Debugging

🤝🏽 Contributing

Code contributions are very much welcome.

  1. Fork the Project
  2. Create your Branch (git checkout -b AmazingFeature)
  3. Commit your Changes (`git commit -m 'Add some AmazingFeature")
  4. Push to the Branch (git push origin AmazingFeature)
  5. Open a Pull Request targetting the main branch.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessiblePeers

type AccessiblePeers struct {
	ID       string `json:"id,omitempty"`
	Name     string `json:"name,omitempty"`
	IP       string `json:"ip,omitempty"`
	DNSLabel string `json:"dns_label,omitempty"`
	UserID   string `json:"user_id,omitempty"`
}

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(token string, opts ...ClientOption) *Client

func (*Client) CreateGroup added in v1.3.0

func (c *Client) CreateGroup(p *Group) (*Group, error)

func (*Client) CreateRoute

func (c *Client) CreateRoute(p *Route) (*Route, error)

func (*Client) CreateSetupKey

func (c *Client) CreateSetupKey(k *SetupKey) (*SetupKey, error)

func (*Client) DeleteGroup added in v1.3.0

func (c *Client) DeleteGroup(id string) error

func (*Client) DeletePeer

func (c *Client) DeletePeer(id string) error

func (*Client) DeleteRoute

func (c *Client) DeleteRoute(id string) error

func (*Client) DeleteSetupKey

func (c *Client) DeleteSetupKey(id string) error

func (*Client) GetGroup added in v1.3.0

func (c *Client) GetGroup(id string) (*Group, error)

func (*Client) GetGroupByName added in v1.3.2

func (c *Client) GetGroupByName(name string) (*Group, error)

func (*Client) GetPeer

func (c *Client) GetPeer(id string) (Peer, error)

func (*Client) GetPeerIdByHostname

func (c *Client) GetPeerIdByHostname(hostname string) (string, error)

func (*Client) GetRoute

func (c *Client) GetRoute(id string) (Route, error)

func (*Client) GetSetupKey

func (c *Client) GetSetupKey(id string) (SetupKey, error)

func (*Client) GetSetupKeyByName

func (c *Client) GetSetupKeyByName(name string) ([]SetupKey, error)

func (*Client) ListGroups added in v1.3.0

func (c *Client) ListGroups() ([]Group, error)

func (*Client) ListPeers

func (c *Client) ListPeers() (Peers, error)

func (*Client) ListRoutes

func (c *Client) ListRoutes() (Routes, error)

func (*Client) ListSetupKeys

func (c *Client) ListSetupKeys() (SetupKeys, error)

func (*Client) UpdateGroup added in v1.3.0

func (c *Client) UpdateGroup(p *Group) (*Group, error)

func (*Client) UpdatePeer

func (c *Client) UpdatePeer(p *Peer) (*Peer, error)

func (*Client) UpdateRoute

func (c *Client) UpdateRoute(p *Route) (*Route, error)

func (*Client) UpdateSetupKey

func (c *Client) UpdateSetupKey(k *SetupKey) (SetupKey, error)

type ClientOption

type ClientOption func(*Client)

func WithManagementAddress

func WithManagementAddress(address string) ClientOption

func WithTimeout

func WithTimeout(timeout time.Duration) ClientOption

type Group added in v1.3.0

type Group struct {
	ID         string       `json:"id,omitempty"`
	Name       string       `json:"name,omitempty"`
	PeersCount int          `json:"peers_count,omitempty"`
	Issued     string       `json:"issued,omitempty"`
	Peers      []GroupPeers `json:"peers,omitempty"`
}

type GroupPeers added in v1.3.0

type GroupPeers struct {
	ID   string `json:"id,omitempty"`
	Name string `json:"name,omitempty"`
}

type Groups

type Groups []Group

type Peer

type Peer struct {
	ID                     string            `json:"id,omitempty"`
	Name                   string            `json:"name,omitempty"`
	IP                     string            `json:"ip,omitempty"`
	Connected              bool              `json:"connected,omitempty"`
	LastSeen               string            `json:"last_seen,omitempty"`
	Os                     string            `json:"os,omitempty"`
	Version                string            `json:"version,omitempty"`
	Groups                 []PeerGroup       `json:"groups,omitempty"`
	SSHEnabled             bool              `json:"ssh_enabled,omitempty"`
	UserID                 string            `json:"user_id,omitempty"`
	Hostname               string            `json:"hostname,omitempty"`
	UIVersion              string            `json:"ui_version,omitempty"`
	DNSLabel               string            `json:"dns_label,omitempty"`
	LoginExpirationEnabled bool              `json:"login_expiration_enabled,omitempty"`
	LoginExpired           bool              `json:"login_expired,omitempty"`
	LastLogin              string            `json:"last_login,omitempty"`
	ApprovalRequired       bool              `json:"approval_required,omitempty"`
	AccessiblePeers        []AccessiblePeers `json:"accessible_peers,omitempty"`
	AcessiblePeersCount    int               `json:"accessible_peers_count,omitempty"`
}

type PeerGroup added in v1.2.0

type PeerGroup struct {
	ID         string `json:"id,omitempty"`
	Name       string `json:"name,omitempty"`
	PeersCount int    `json:"peers_count,omitempty"`
	Issued     string `json:"issued,omitempty"`
}

type Peers

type Peers []Peer

type Route

type Route struct {
	ID          string   `json:"id,omitempty"`
	NetworkType string   `json:"network_type,omitempty"`
	Description string   `json:"description,omitempty"`
	NetworkID   string   `json:"network_id,omitempty"`
	Enabled     bool     `json:"enabled,omitempty"`
	Peer        string   `json:"peer,omitempty"`
	PeerGroups  []string `json:"peer_groups,omitempty"`
	Network     string   `json:"network,omitempty"`
	Metric      int      `json:"metric,omitempty"`
	Masquerade  bool     `json:"masquerade,omitempty"`
	Groups      []string `json:"groups,omitempty"`
}

type Routes

type Routes []Route

type SetupKey

type SetupKey struct {
	ID         string   `json:"id,omitempty"`
	Key        string   `json:"key,omitempty"`
	Name       string   `json:"name,omitempty"`
	ExpiresIn  int      `json:"expires_in,omitempty"`
	Expires    string   `json:"expires,omitempty"`
	Type       string   `json:"type,omitempty"`
	Valid      bool     `json:"valid,omitempty"`
	Revoked    bool     `json:"revoked,omitempty"`
	UsedTimes  int      `json:"used_times,omitempty"`
	LastUsed   string   `json:"last_used,omitempty"`
	State      string   `json:"state,omitempty"`
	AutoGroups []string `json:"auto_groups,omitempty"`
	UpdatedAt  string   `json:"updated_at,omitempty"`
	UsageLimit int      `json:"usage_limit,omitempty"`
	Ephemeral  bool     `json:"ephemeral,omitempty"`
}

type SetupKeys

type SetupKeys []SetupKey

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL