golang-zerotier-service-api

module
v0.0.0-...-81e5d63 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2024 License: MIT

README

Golang-zerotier-service-api

A Golang wrapper for the Zerotier Service API

This package was created for usage in the GameKube project.

Calls

The following API calls are currently implemented:

  • Join network
  • Leave network
  • Get status

Installation

Install the package with:

go get github.com/PimSanders/golang-zerotier-service-api

Usage

Create a new client:

zts := golangzerotierserviceapi.NewClient("https://api.zerotier.com/api/v1", "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", false)

Join a network:

resp, err := zts.JoinNetwork("BBBBBBBBBBBBBBBB")

if err != nil {
	log.Panic(err)
}

fmt.Println(resp.Result)

Leave a network:

resp, err := zts.LeaveNetwork("BBBBBBBBBBBBBBBB")

if err != nil {
	log.Panic(err)
}

fmt.Println(resp.Status)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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