utils

package
v0.0.0-...-f545d20 Latest Latest
Warning

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

Go to latest
Published: May 13, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Epoch = time.Unix(0, 0)

Functions

func Float64FromString

func Float64FromString(s string) float64

func HashFromString

func HashFromString(s string) uint32

func HashFromTime

func HashFromTime(t time.Time) uint32

func ReadFile

func ReadFile(file string) []byte

func Round

func Round(n float64, decimals uint32) float64

func StringContains

func StringContains(arr []string, value string) bool

func ToFixed

func ToFixed(num float64, precision int) float64

func ToString

func ToString(v interface{}) string

func ToUnixMillisFromTimeStamp

func ToUnixMillisFromTimeStamp(ts int64) time.Time

Types

type Queue

type Queue struct {
	// contains filtered or unexported fields
}

Queue represents a double-ended queue. The zero value is an empty queue ready to use.

func NewQueue

func NewQueue() *Queue

NewQueue returns an initialized empty queue.

func (*Queue) Back

func (q *Queue) Back() interface{}

Back returns the last element of queue q or nil.

func (*Queue) Empty

func (q *Queue) Empty() bool

empty returns true if the queue q has no elements.

func (*Queue) Front

func (q *Queue) Front() interface{}

Front returns the first element of queue q or nil.

func (*Queue) Init

func (q *Queue) Init() *Queue

Init initializes or clears queue q.

func (*Queue) Len

func (q *Queue) Len() int

Len returns the number of elements of queue q.

func (*Queue) PopBack

func (q *Queue) PopBack() interface{}

PopBack removes and returns the last element of queue q or nil.

func (*Queue) PopFront

func (q *Queue) PopFront() interface{}

PopFront removes and returns the first element of queue q or nil.

func (*Queue) PushBack

func (q *Queue) PushBack(v interface{})

PushBack inserts a new value v at the back of queue q.

func (*Queue) PushFront

func (q *Queue) PushFront(v interface{})

PushFront inserts a new value v at the front of queue q.

func (*Queue) String

func (q *Queue) String() string

String returns a string representation of queue q formatted from front to back.

Jump to

Keyboard shortcuts

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