util

package
v0.0.0-...-938bef1 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2017 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Overview

File taken from docker code base at https://raw.githubusercontent.com/docker/docker/master/pkg/namesgenerator/names-generator.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultConfigPath

func DefaultConfigPath(app string) string

func GetRandomName

func GetRandomName(retry int) string

GetRandomName generates a random name from the list of adjectives and surnames in this package formatted as "adjective_surname". For example 'focused_turing'. If retry is non-zero, a random integer between 0 and 10 will be added to the end of the name, e.g `focused_turing3`

func PointToString64

func PointToString64(point abstract.Point) (string, error)

PointToString64 converts a point to a base64 representation

func PointToStringHex

func PointToStringHex(suite abstract.Suite, point abstract.Point) (string, error)

PointToStringHex converts a point to a hexadecimal representation

func Read64Point

func Read64Point(suite abstract.Suite, r io.Reader) (abstract.Point, error)

Read64Point reads a point from a base64 representation

func Read64Scalar

func Read64Scalar(suite abstract.Suite, r io.Reader) (abstract.Scalar, error)

Read64Scalar takes a Base64-encoded scalar and returns that scalar, optionally an error

func ReadHexPoint

func ReadHexPoint(suite abstract.Suite, r io.Reader) (abstract.Point, error)

ReadHexPoint reads a point from a hex representation

func ReadHexScalar

func ReadHexScalar(suite abstract.Suite, r io.Reader) (abstract.Scalar, error)

ReadHexScalar takes a hex-encoded scalar and returns that scalar, optionally an error

func ScalarToString64

func ScalarToString64(scalar abstract.Scalar) (string, error)

ScalarToString64 encodes a scalar to a base64

func ScalarToStringHex

func ScalarToStringHex(suite abstract.Suite, scalar abstract.Scalar) (string, error)

ScalarToStringHex encodes a scalar to hexadecimal

func String64ToPoint

func String64ToPoint(suite abstract.Suite, s string) (abstract.Point, error)

String64ToPoint reads a base64 representation of a point and converts it back to a point.

func String64ToScalar

func String64ToScalar(suite abstract.Suite, str string) (abstract.Scalar, error)

String64ToScalar reads a scalar in base64 from a string

func StringHexToPoint

func StringHexToPoint(suite abstract.Suite, s string) (abstract.Point, error)

StringHexToPoint reads a hexadecimal representation of a point and convert it to the right struct

func StringHexToScalar

func StringHexToScalar(suite abstract.Suite, str string) (abstract.Scalar, error)

StringHexToScalar reads a scalar in hexadecimal from string

func Write64Point

func Write64Point(suite abstract.Suite, w io.Writer, point abstract.Point) error

Write64Point writes a point to a base64 representation

func Write64Scalar

func Write64Scalar(suite abstract.Suite, w io.Writer, scalar abstract.Scalar) error

Write64Scalar converts a scalar key to a Base64-string

func WriteHexPoint

func WriteHexPoint(suite abstract.Suite, w io.Writer, point abstract.Point) error

WriteHexPoint writes a point to a hex representation

func WriteHexScalar

func WriteHexScalar(suite abstract.Suite, w io.Writer, scalar abstract.Scalar) error

WriteHexScalar converts a scalar key to a hex-string

Types

type Config

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

func NewConfig

func NewConfig(app string) *Config

func NewConfigWithPath

func NewConfigWithPath(path string) *Config

func (*Config) Dir

func (c *Config) Dir(folder string) *Config

func (*Config) List

func (c *Config) List(match string) []string

func (*Config) ListDir

func (c *Config) ListDir() ([]string, error)

func (*Config) Path

func (c *Config) Path() string

func (*Config) Read

func (c *Config) Read(fname string, i interface{}) error

func (*Config) RelPath

func (c *Config) RelPath(fname string) string

func (*Config) Write

func (c *Config) Write(fname string, i interface{}) error

type Tomler

type Tomler interface {
	Toml() interface{}
	FromToml(string) error
}

Jump to

Keyboard shortcuts

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