lib

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2018 License: MIT Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BasicAuth

func BasicAuth(username, password string) string

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 CheckFreePort

func CheckFreePort(ip string, port int) (int, error)

func Contains added in v0.4.1

func Contains(a []string, x string) bool

Contains - ищем в масиве строк нужную строку

func FilteringMode

func FilteringMode(src string, key int) string

FilteringMode - return sql operator

func GenUpdates

func GenUpdates(a, b []string) []*naming.Update

func GetFreePort

func GetFreePort(ip string, start int, end int) (port int, err error)

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

func GetFullNumber(card string, limit int) (res string)

GetFullNumber - Возвращает номер заполняя в начале нулями определенной длины card - изнвчальное число limit - длина символов в результате format 1234567 -> 0001234567

func GetPort

func GetPort(ip string) (port int, err error)

GetPort свободный порт в диапазоне от 9000 до 50000

func GetTodayShow added in v0.4.1

func GetTodayShow() string

GetTodayShow - возвращает текущую дату как строка 20180624

func GetTotal added in v0.4.1

func GetTotal(cnt int64, max int64) int64

GetTotal - возвращает округленное число до большего

func IsExits added in v0.4.1

func IsExits(name string, args []string) bool

IsExits - проверяем есть ли такой аргумент

args := []string{"sub", "arg1", "arg2"}
fmt.Println("is exits:", IsExits("arg2", args))

func ParseBasicAuth

func ParseBasicAuth(auth string) (username, password string, ok bool)

ParseBasicAuth parses an HTTP Basic Authentication string. "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==" returns ("Aladdin", "open sesame", true).

func RandNumberSeq added in v0.5.0

func RandNumberSeq(n int) string

RandNumberSeq generate random number string

func RandSeq added in v0.5.0

func RandSeq(n int) string

RandSeq - generate random string

func ReplaceNameToKey

func ReplaceNameToKey(src string, stopWord string) (result string)

ReplaceNameToKey - преобразуем строку в ключ для CouchDB src := "Привет|name? \\ / {} ! `@#$%^&()-+=~ '<[ витя \"рога Копїта \"]>' = 1.2кг 1,03" stopWord := " кг | для | литр | і | и | нет" @response - привет_name_витя_рога_копїта

func ResolveHostIp

func ResolveHostIp() string

ResolveHostIp - IP Адресс внешнего интерфейса

func SetBasicAuth

func SetBasicAuth(username, password string) string

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.

Jump to

Keyboard shortcuts

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