tools

package
v0.0.0-...-82fb81f Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2021 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckFlagValid

func CheckFlagValid(wireguard WGConfig, cmd string) error

CheckFlagValid Checks that nothing is missing or that a flag as all the requirements

func CreateEmoji

func CreateEmoji() string

CreateEmoji Creates the planet emoji present in the Asteroid help info

func HandleFlags

func HandleFlags(args []string) (*string, *string, *string, *bool, *bool)

HandleFlags init flags and checks which was given

func ReadPubKey

func ReadPubKey(sshKeyPath string) (ssh.AuthMethod, error)

ReadPubKey Reads ssh key previously obtained

func RetrievePubKey

func RetrievePubKey(sshKey string) (string, error)

RetrievePubKey Will go to the .ssh folder in the user $HOME, retrieve the ssh key and connect to the Wireguard server

func SortedListPeer

func SortedListPeer(listPeer []map[string]string)

SortedListPeer Sorts to show list with asc order

Types

type WGConfig

type WGConfig struct {
	PeerKey        string
	PeerCIDR       string
	PeerDeleteKey  string
	GenerateFile   bool
	GenerateOutput bool

	ServerPubKey string
	// contains filtered or unexported fields
}

WGConfig Struct is for all related info to create peer on WG server

func InitWG

func InitWG(args []string) (WGConfig, error)

InitWG Init a Wireguard object to keep all related variables in one place

func (WGConfig) RetrieveWGConfig

func (wg WGConfig) RetrieveWGConfig() error

RetrieveWGConfig Will call the show, writeFile or WriteOutput Wiregard config function

Jump to

Keyboard shortcuts

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