Documentation ¶
Index ¶
- Variables
- func DirExists(path string) (bool, error)
- func EnsureDir(dir string, mode os.FileMode) error
- func FromPEMFile(o encoding.BinaryUnmarshaler, f, pemType string) error
- func GetLocalIP() (string, error)
- func IsZeroElement(el sphinx.CryptoElement) bool
- func RandomExponential(expParam float64) (float64, error)
- func RandomMix(mixes []config.MixConfig) config.MixConfig
- func RandomString(length int) string
- func RegisterMixNodePresence(publicKey *sphinx.PublicKey, layer int, host ...string) error
- func RegisterMixProviderPresence(publicKey *sphinx.PublicKey, clients []models.RegisteredClient, host ...string) error
- func ResolveTCPAddress(host, port string) (*net.TCPAddr, error)
- func SHA256(arg []byte) ([]byte, error)
- func SendMixMetrics(metric models.MixMetric, host ...string) error
- func ToPEMFile(o encoding.BinaryMarshaler, f, pemType string) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrPermEmptyList = errors.New("cannot permute an empty list of mixes") ErrTooBigSampleSize = errors.New("cannot take a sample larger than the given list") ErrExponentialDistributionParam = errors.New("the parameter of exponential distribution has to be larger than zero") )
View Source
var (
ErrInvalidLocalIP = errors.New("couldn't find a valid IP for your machine, check your internet connection")
)
Functions ¶
func EnsureDir ¶
EnsureDir checks whether a directory exists at the given path. If not, it will be created.
func FromPEMFile ¶
func FromPEMFile(o encoding.BinaryUnmarshaler, f, pemType string) error
func GetLocalIP ¶
GetLocalIP attempts to figure out a valid IP address for this machine.
func IsZeroElement ¶
func IsZeroElement(el sphinx.CryptoElement) bool
func RandomExponential ¶
func RandomString ¶
a very dummy implementation of getting "random" string of given length could be improved in number of ways but for the test sake it's good enough
func RegisterMixNodePresence ¶
RegisterMixNodePresence registers server presence at the directory server.
func RegisterMixProviderPresence ¶
func RegisterMixProviderPresence(publicKey *sphinx.PublicKey, clients []models.RegisteredClient, host ...string) error
RegisterMixProviderPresence registers server presence at the directory server.
func ResolveTCPAddress ¶
ResolveTCPAddress returns an address of TCP end point given a host and port.
func SendMixMetrics ¶
SendMixMetrics sends the mixnode related packet metrics to the directory server.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.