Documentation ¶
Index ¶
- Constants
- func ArrayChunk(array interface{}, size int) []interface{}
- func ArrayCombine(keys interface{}, values interface{}) map[interface{}]interface{}
- func ArrayCountValues(array interface{}) map[interface{}]int
- func ArrayDiff(arrays ...interface{}) []interface{}
- func ArrayFilter(array interface{}, callback interface{}) []interface{}
- func ArrayIntersect(arrays ...interface{}) []interface{}
- func ArrayMap(array interface{}, callback interface{}) []interface{}
- func ArraySum(array interface{}) (float64, error)
- func Date(args ...interface{}) string
- func FileExists(fileName string) bool
- func FileGetContents(path string, args ...interface{}) (string, error)
- func FilePutContents(fileName, data string, flags ...interface{}) (int, error)
- func GetMxrr(domain string) (isMx bool, mxs []*net.MX, err error)
- func HTTPBuildQuery(pairs map[string]string) string
- func HashFile(algo, fileName string) (string, error)
- func IP2long(ipAddr string) (uint32, error)
- func InArray(needle interface{}, haystack interface{}) bool
- func IsDir(fileName string) bool
- func IsFile(fileName string) bool
- func IsLink(fileName string) bool
- func Long2ip(ipLong uint32) string
- func Md5(s string) string
- func Rand(min, max int64) int64
- func Range(min, max int, step ...interface{}) []int
- func Serialize(val interface{}) (string, error)
- func Sha1(s string) string
- func Sha2(s string) string
- func StrIReplace(args ...interface{}) (string, error)
- func StrReplace(args ...interface{}) (string, error)
- func UnixMicro() int64
- func UnixMilli() int64
- func Unserialize(val string, v interface{}) error
- type Context
- type Item
- type PriorityQueue
- func (pq *PriorityQueue) Init()
- func (pq PriorityQueue) Len() int
- func (pq PriorityQueue) Less(i, j int) bool
- func (pq *PriorityQueue) Pop() interface{}
- func (pq *PriorityQueue) Push(x interface{})
- func (pq PriorityQueue) Swap(i, j int)
- func (pq *PriorityQueue) Update(item *Item, value string, priority int)
- type Time
Constants ¶
const ( DivideMicroseconds = 1e3 DivideMilliseconds = 1e6 )
const (
FileAppend = os.O_APPEND
)
const mapping php -> go
Variables ¶
This section is empty.
Functions ¶
func ArrayChunk ¶
func ArrayChunk(array interface{}, size int) []interface{}
ArrayChunk split an array into chunks
func ArrayCombine ¶
func ArrayCombine(keys interface{}, values interface{}) map[interface{}]interface{}
ArrayCombine creates an array by using one array for keys and another for its values returns map[key]value if both slices are equal and nil otherwise
func ArrayCountValues ¶
func ArrayCountValues(array interface{}) map[interface{}]int
ArrayCountValues counts all the values of an array/slice
func ArrayDiff ¶
func ArrayDiff(arrays ...interface{}) []interface{}
ArrayDiff compares array1 against one or more other arrays returns the values in array1 that are not present in any of the other arrays
func ArrayFilter ¶
func ArrayFilter(array interface{}, callback interface{}) []interface{}
ArrayFilter filters elements of an array using a callback function
func ArrayIntersect ¶
func ArrayIntersect(arrays ...interface{}) []interface{}
ArrayIntersect computes the intersection of arrays
func ArrayMap ¶
func ArrayMap(array interface{}, callback interface{}) []interface{}
ArrayMap applies the callback to the elements of the given arrays
func Date ¶
func Date(args ...interface{}) string
Date returns formatted output of system data/time 1st argument formatted string e.g.: Y-m-d H:i:s 2nd argument int64 unix timestamp
func FileExists ¶
FileExists checks wether file or catalog exists or not returning true or false respectfully
func FileGetContents ¶
FileGetContents reads files, http requests streams fileName name of file to where put data flags[0] - offset flags[1] - maxLen
func FilePutContents ¶
FilePutContents write files with offset/limit fileName name of file to where put data flags[0] - flags how to put this data FileAppend | LockEx
func GetMxrr ¶
GetMxrr Get MX records corresponding to a given Internet host name Returns TRUE if any records are found; returns FALSE if no records were found or if an error occurred
func HTTPBuildQuery ¶
HTTPBuildQuery Generates a URL-encoded query string from the associative map
func HashFile ¶
HashFile hashs file fileName by calculating hash md5/sha1/sha2 based on it's content
func IP2long ¶
IP2long converts a string containing an (IPv4) Internet Protocol dotted address into a long integer
func InArray ¶
func InArray(needle interface{}, haystack interface{}) bool
InArray checks if a value exists in an array
func Long2ip ¶
Long2ip converts an long integer address into a string in (IPv4) Internet standard dotted format
func Rand ¶
Rand returns a pseudo-random integer between min and max based on unix-nano time seed !! for random numbers suitable for security-sensitive work, use the crypto/rand package instead
func Range ¶
Range creates int slice of min to max range If a step value is given, it will be used as the increment between elements in the sequence. step should be given as a positive number. If not specified, step will default to 1.
func StrIReplace ¶
StrIReplace replaces all occurrences of the search case-insensitive string|slice with the replacement string If search and replace are arrays, then str_replace() takes a value from each array and uses them to search and replace on subject.
func StrReplace ¶
StrReplace replaces all occurrences of the search string|slice with the replacement string If search and replace are arrays, then str_replace() takes a value from each array and uses them to search and replace on subject.
func Unserialize ¶
Unserialize decodes string back into Go code representation
Types ¶
type Context ¶
type Context struct { Headers map[string]string RequestMethod string Req *http.Request UploadMaxFileSize int64 }
Context is the opts for http/net requests
func NewContext ¶
func NewContext() *Context
NewContext returns a new Context with preset default headers and request method
func (*Context) MoveUploadedFile ¶
MoveUploadedFile uploads file from fieldName to destination path
type Item ¶
type Item struct { Value string // The Value of the item; arbitrary. Priority int // The Priority of the item in the queue. // The Index is needed by update and is maintained by the heap.Interface methods. Index int // The Index of the item in the heap. }
An Item is something we manage in a Priority queue.
type PriorityQueue ¶
type PriorityQueue []*Item
A PriorityQueue implements heap.Interface and holds Items.
func (*PriorityQueue) Init ¶
func (pq *PriorityQueue) Init()
func (PriorityQueue) Len ¶
func (pq PriorityQueue) Len() int
func (PriorityQueue) Less ¶
func (pq PriorityQueue) Less(i, j int) bool
func (*PriorityQueue) Pop ¶
func (pq *PriorityQueue) Pop() interface{}
func (*PriorityQueue) Push ¶
func (pq *PriorityQueue) Push(x interface{})
func (PriorityQueue) Swap ¶
func (pq PriorityQueue) Swap(i, j int)