common

package
v3.0.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2017 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package common contains common utilities that are shared among other packages. See each sub-package for detail.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateObject

func CreateObject(ctx context.Context, config interface{}) (interface{}, error)

CreateObject creates an object by its config. The config type must be registered through RegisterConfig().

func Must

func Must(err error)

Must panics if err is not nil.

func Must2

func Must2(v interface{}, err error)

Must2 panics if the second parameter is not nil.

func RegisterConfig

func RegisterConfig(config interface{}, configCreator ConfigCreator) error

RegisterConfig registers a global config creator. The config can be nil but must have a type.

Types

type ConfigCreator

type ConfigCreator func(ctx context.Context, config interface{}) (interface{}, error)

ConfigCreator is a function to create an object by a config.

Directories

Path Synopsis
Package buf provides a light-weight memory allocation mechanism.
Package buf provides a light-weight memory allocation mechanism.
Package crypto provides common crypto libraries for V2Ray.
Package crypto provides common crypto libraries for V2Ray.
Package dice contains common functions to generate random number.
Package dice contains common functions to generate random number.
Package errors is a drop-in replacement for Golang lib 'errors'.
Package errors is a drop-in replacement for Golang lib 'errors'.
net
Package net is a drop-in replacement to Golang's net package, with some more functionalities.
Package net is a drop-in replacement to Golang's net package, with some more functionalities.

Jump to

Keyboard shortcuts

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