utils

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Hash

func Hash(data []byte) string

func HashString

func HashString(value string) string

Types

type Color

type Color struct {
	R byte
	G byte
	B byte
}

func ColorFromUint

func ColorFromUint(value uint32) Color

func (Color) MarshalJSON

func (c Color) MarshalJSON() ([]byte, error)

func (Color) ToHex

func (c Color) ToHex() string

func (Color) ToUint

func (c Color) ToUint() (color uint32)

func (*Color) UnmarshalJSON

func (c *Color) UnmarshalJSON(data []byte) error

type Session

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

func NewSession

func NewSession(ctx context.Context) Session

func (*Session) Cancel

func (s *Session) Cancel()

func (*Session) Ctx

func (s *Session) Ctx() context.Context

func (*Session) IsDone

func (s *Session) IsDone() bool

func (*Session) Started

func (s *Session) Started() time.Time

type Subscriber

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

func (*Subscriber[T]) Done

func (t *Subscriber[T]) Done()

func (*Subscriber[T]) Recv

func (t *Subscriber[T]) Recv() <-chan T

type Topic

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

func NewTopic

func NewTopic[T any]() *Topic[T]

func (*Topic[T]) Publish

func (t *Topic[T]) Publish(value T)

func (*Topic[T]) Subscribe

func (t *Topic[T]) Subscribe() *Subscriber[T]

Jump to

Keyboard shortcuts

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