util

package
v0.0.0-...-c40e111 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2024 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const CharSet = "ABCDEFGHJKLMNPQRSTUVWXYZabcdefghjkmnpqrstuvwxyz123456789"

Variables

This section is empty.

Functions

func Bool

func Bool(b bool) *bool

func CloseConnection

func CloseConnection(c *websocket.Conn)

func GenerateRandomString

func GenerateRandomString(length int) string

func Int

func Int(a int) *int

func IsNameValid

func IsNameValid(username string) bool

func IsURLAllowed

func IsURLAllowed(urlStr string) (bool, error)

func URLHash

func URLHash(urlStr string) (string, error)

func WrapStringArray

func WrapStringArray(strings ...string) (res []interface{})

Types

type Bob

type Bob struct {
	strings.Builder
}

func (*Bob) All

func (e *Bob) All(str ...interface{})

func (*Bob) Alll

func (e *Bob) Alll(str ...interface{})

func (*Bob) Bytes

func (e *Bob) Bytes() []byte

func (*Bob) If

func (*Bob) If(cond bool, str string) string

func (*Bob) IfElse

func (*Bob) IfElse(cond bool, str, els string) string

func (*Bob) NewLine

func (e *Bob) NewLine(repeat ...int)

func (*Bob) Writef

func (e *Bob) Writef(msg string, args ...interface{})

func (*Bob) Writefl

func (e *Bob) Writefl(msg string, args ...interface{})

func (*Bob) Writel

func (e *Bob) Writel(msg string)

type Boundaries

type Boundaries []*BoundaryInt

func Bounds

func Bounds(boundaries ...*BoundaryInt) Boundaries

func (Boundaries) Applies

func (B Boundaries) Applies(a int) bool

func (Boundaries) String

func (B Boundaries) String() string

type BoundaryInt

type BoundaryInt struct {
	Min   *int
	Max   *int
	Exact *int
}

func BoundExact

func BoundExact(exact int) *BoundaryInt

func BoundMax

func BoundMax(max int) *BoundaryInt

func BoundMin

func BoundMin(min int) *BoundaryInt

func (*BoundaryInt) Applies

func (i *BoundaryInt) Applies(a int) bool

func (BoundaryInt) String

func (i BoundaryInt) String() string

type GameState

type GameState int
const (
	StateLobby GameState = 1 << iota
	StateSubmitGIF
	StateCastVotes
	StateShowVotes
)

func (GameState) Contains

func (g GameState) Contains(state GameState) bool

func (GameState) In

func (g GameState) In(other GameState) bool

Jump to

Keyboard shortcuts

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