Documentation ¶
Index ¶
- Variables
- func B2S(b []byte) string
- func BoolPointer(b bool) *bool
- func CleanUpMessageAccept(s *discordgo.Session, msg *discordgo.Message, ttl time.Duration, id string)
- func CleanUpMessageDeny(s *discordgo.Session, msg *discordgo.Message, ttl time.Duration, id string)
- func Contains(s []string, compare string) bool
- func ContainsObjectID(oid []primitive.ObjectID, compare primitive.ObjectID) bool
- func DifferentArray(a []string, b []string) bool
- func FindMember(s *discordgo.Session, guild *discordgo.Guild, msg *discordgo.Message, ...) *discordgo.Member
- func FindMemberSearch(guild *discordgo.Guild, search string) *discordgo.Member
- func GenerateRandomBytes(n int) ([]byte, error)
- func GenerateRandomString(s int) (string, error)
- func GetSizeRatio(og []float64, nw []float64) (int32, int32)
- func Int32Pointer(i int32) *int32
- func Int64Pointer(i int64) *int64
- func IsPointer(v interface{}) bool
- func IsPowerOfTwo(n int64) bool
- func IsSliceArray(v interface{}) bool
- func IsSliceArrayPointer(v interface{}) bool
- func NewID() int64
- func S2B(s string) (b []byte)
- func SliceIndexOf(s []string, val string) int
- func SteamID3ToSteamID(sid uint64) steamid.SteamId
- func SteamID3ToSteamID64(sid uint64) uint64
- func SteamID64ToSteamID(sid uint64) steamid.SteamId
- func SteamID64ToSteamID3(sid uint64) uint64
- func SteamIDToSteamID3(sid steamid.SteamId) uint64
- func SteamIDToSteamID64(sid steamid.SteamId) uint64
- func StringPointer(s string) *string
- func Ternary(condition bool, whenTrue interface{}, whenFalse interface{}) interface{}
- type Key
Constants ¶
This section is empty.
Variables ¶
var BitField = bitField{}
var Epoch = time.Unix(1624968960, 0)
Functions ¶
func B2S ¶
b2s converts byte slice to a string without memory allocation. See https://groups.google.com/forum/#!msg/Golang-Nuts/ENgbUzYvCuU/90yGx7GUAgAJ .
Note it may break if string and/or slice header will change in the future go versions.
func BoolPointer ¶
func CleanUpMessageAccept ¶
func CleanUpMessageDeny ¶
func ContainsObjectID ¶
func DifferentArray ¶
func FindMember ¶
func FindMemberSearch ¶
func GenerateRandomBytes ¶
GenerateRandomBytes returns securely generated random bytes. It will return an error if the system's secure random number generator fails to function correctly, in which case the caller should not continue.
func GenerateRandomString ¶
GenerateRandomString returns a URL-safe, base64 encoded securely generated random string. It will return an error if the system's secure random number generator fails to function correctly, in which case the caller should not continue.
func GetSizeRatio ¶
Obtain the size ratio of width and height values For image resizing
func Int32Pointer ¶
func Int64Pointer ¶
func IsSliceArray ¶
func IsSliceArray(v interface{}) bool
func IsSliceArrayPointer ¶
func IsSliceArrayPointer(v interface{}) bool
func S2B ¶
S2B converts string to a byte slice without memory allocation.
Note it may break if string and/or slice header will change in the future go versions.