lib

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateTimeRanges added in v0.0.2

func GenerateTimeRanges(start, end time.Time, interval time.Duration) []time.Time

func GetEnv

func GetEnv(key string) (string, error)

func Join

func Join[T any](vals []T, sep string, f func(T) string) string

func NewInvalidAstError

func NewInvalidAstError(msg string) error

func NewUnsupportedError

func NewUnsupportedError(msg string) error

func NormalizeTimeByHour

func NormalizeTimeByHour(t time.Time) time.Time

func Ptr

func Ptr[T any](v T) *T

func SliceOrEmpty

func SliceOrEmpty[T any](vals []T) []T

func Sort

func Sort[T any, U constraints.Ordered](vals []T, f func(v T) U)

func UniqBy

func UniqBy[T any, U comparable](vals []T, fn func(T) U) []T

Types

type HttpTransport

type HttpTransport struct {
	Transport http.RoundTripper
}

func NewHttpTransport

func NewHttpTransport() *HttpTransport

func (*HttpTransport) RoundTrip

func (ht *HttpTransport) RoundTrip(req *http.Request) (*http.Response, error)

type InvalidAstError

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

func (*InvalidAstError) Error

func (ie *InvalidAstError) Error() string

type LimitedHeap added in v0.0.2

type LimitedHeap[T any] struct {
	// contains filtered or unexported fields
}

func NewLimitedHeap added in v0.0.2

func NewLimitedHeap[T any](limit int, less func(a, b T) bool) *LimitedHeap[T]

func (LimitedHeap[T]) Len added in v0.0.2

func (h LimitedHeap[T]) Len() int

func (LimitedHeap[T]) PopAll added in v0.0.2

func (h LimitedHeap[T]) PopAll() []T

func (LimitedHeap[T]) Push added in v0.0.2

func (h LimitedHeap[T]) Push(x T)

type Set

type Set[T comparable] struct {
	// contains filtered or unexported fields
}

func NewSet

func NewSet[T comparable]() *Set[T]

func NewSetS

func NewSetS[T comparable](origins []T) *Set[T]

func (*Set[T]) Add

func (s *Set[T]) Add(val T)

func (*Set[T]) Contains

func (s *Set[T]) Contains(val T) bool

func (*Set[T]) Count

func (s *Set[T]) Count() int

func (*Set[T]) Delete

func (s *Set[T]) Delete(val T)

func (*Set[T]) Merge

func (s *Set[T]) Merge(os *Set[T])

func (*Set[T]) Values

func (s *Set[T]) Values() []T

type Stack

type Stack[T any] struct {
	// contains filtered or unexported fields
}

func NewStack

func NewStack[T any](vals ...*T) *Stack[T]

func (*Stack[T]) Pop

func (s *Stack[T]) Pop() *T

func (*Stack[T]) Push

func (s *Stack[T]) Push(val *T)

func (*Stack[T]) Size

func (s *Stack[T]) Size() int

func (*Stack[T]) Top

func (s *Stack[T]) Top() *T

type UnsupportedError

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

func (*UnsupportedError) Error

func (ue *UnsupportedError) Error() string

Jump to

Keyboard shortcuts

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