misc

package
v3.2.3 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package misc provides general purpose utilities for rait

Index

Constants

This section is empty.

Variables

View Source
var Bind bool
View Source
var IPNetAll = []net.IPNet{{IP: _4b[:], Mask: _4b[:]}, {IP: _16b[:], Mask: _16b[:]}}

IPNetALL is simply 0/0 plus ::/0

Functions

func LinkIn

func LinkIn(links []Link, link Link) bool

func LinkString

func LinkString(links []Link) (stringed []string)

func NewAF

func NewAF(af string) string

func NewLLAddr

func NewLLAddr() *netlink.Addr

NewLLAddr generates a RFC 4862 compliant linklocal address, from a random mac address

func NewReadCloser

func NewReadCloser(path string) (io.ReadCloser, error)

NewReadCloser returns a ReadCloser from the given path path can be a file system path, a http url, or "-" for stdin

func NewWriteCloser

func NewWriteCloser(path string) (io.WriteCloser, error)

NewWriteCloser returns a WriteCloser from the given path path can be a file system path, or "-" for stdout

func ResolveBindAddress

func ResolveBindAddress(af string, addrSpec string) net.IP

func StringIn

func StringIn(list []string, item string) bool

func UnmarshalHCL

func UnmarshalHCL(path string, v interface{}) error

UnmarshalHCL decodes the hcl file read from path then unmarshal it into the given interface

func UnmarshalTOML

func UnmarshalTOML(path string, v interface{}) error

UnmarshalTOML decodes the toml file read from path then unmarshal it into the given interface

Types

type Link struct {
	Name   string
	MTU    int
	Config wgtypes.Config
}

Link represents a single link managed by isolation

Jump to

Keyboard shortcuts

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