utils

package
v3.3.1 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2019 License: BSD-2-Clause Imports: 17 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidStatePath = errors.New("Invalid state file path")
	ErrNoState          = errors.New("No state available")
)

Functions

func OpenBufferedFileReader

func OpenBufferedFileReader(p string, buffer int) (r io.ReadCloser, err error)

func OpenFileReader

func OpenFileReader(p string) (r io.ReadCloser, err error)

func ParseInt

func ParseInt(v string) (r uint64, err error)

func ParseSource

func ParseSource(v string) (ret net.IP, err error)

ParseSource attempts to parse a string as a source override The priority logic is:

  1. IP address
  2. Numeric ID
  3. hexadecimal hash

Types

type State added in v3.3.1

type State struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewState added in v3.3.1

func NewState(pth string, perm os.FileMode) (s *State, err error)

func (*State) Read added in v3.3.1

func (s *State) Read(f interface{}) (err error)

func (*State) Write added in v3.3.1

func (s *State) Write(f interface{}) (err error)

Jump to

Keyboard shortcuts

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