Documentation ¶
Index ¶
- func BasicAuth(username, password string) string
- func CheckFreePort(ip string, port int) (int, error)
- func Contains(a []string, x string) bool
- func FilteringMode(src string, key int) string
- func GenUpdates(a, b []string) []*naming.Update
- func GetFreePort(ip string, start int, end int) (port int, err error)
- func GetFullNumber(card string, limit int) (res string)
- func GetPort(ip string) (port int, err error)
- func GetTodayShow() string
- func GetTotal(cnt int64, max int64) int64
- func IsExits(name string, args []string) bool
- func ParseBasicAuth(auth string) (username, password string, ok bool)
- func RandNumberSeq(n int) string
- func RandSeq(n int) string
- func ReplaceNameToKey(src string, stopWord string) (result string)
- func ResolveHostIp() string
- func SetBasicAuth(username, password string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BasicAuth ¶
BasicAuth - see 2 (end of page 4) http://www.ietf.org/rfc/rfc2617.txt "To receive authorization, the client sends the userid and password, separated by a single colon (":") character, within a base64 encoded string in the credentials." It is not meant to be urlencoded.
func FilteringMode ¶
FilteringMode - return sql operator
func GenUpdates ¶
func GetFreePort ¶
GetFreePort - поиск свободного порта из диапазона
port, err := core.GetFreePort("localhost", 9000, 9999) if err != nil { fmt.Println(err.Error()) } fmt.Println("free port: ", port)
func GetFullNumber ¶ added in v0.4.1
GetFullNumber - Возвращает номер заполняя в начале нулями определенной длины card - изнвчальное число limit - длина символов в результате format 1234567 -> 0001234567
func GetTodayShow ¶ added in v0.4.1
func GetTodayShow() string
GetTodayShow - возвращает текущую дату как строка 20180624
func IsExits ¶ added in v0.4.1
IsExits - проверяем есть ли такой аргумент
args := []string{"sub", "arg1", "arg2"} fmt.Println("is exits:", IsExits("arg2", args))
func ParseBasicAuth ¶
ParseBasicAuth parses an HTTP Basic Authentication string. "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==" returns ("Aladdin", "open sesame", true).
func RandNumberSeq ¶ added in v0.5.0
RandNumberSeq generate random number string
func ReplaceNameToKey ¶
ReplaceNameToKey - преобразуем строку в ключ для CouchDB src := "Привет|name? \\ / {} ! `@#$%^&()-+=~ '<[ витя \"рога Копїта \"]>' = 1.2кг 1,03" stopWord := " кг | для | литр | і | и | нет" @response - привет_name_витя_рога_копїта
func SetBasicAuth ¶
SetBasicAuth - sets the request's Authorization header to use HTTP Basic Authentication with the provided username and password.
With HTTP Basic Authentication the provided username and password are not encrypted.
Types ¶
This section is empty.