moreatomic

package
v0.12.6 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2020 License: ISC Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bool

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

func (*Bool) Get

func (b *Bool) Get() bool

func (*Bool) Set

func (b *Bool) Set(val bool)

type CtxMutex added in v0.6.2

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

func NewCtxMutex added in v0.6.2

func NewCtxMutex() *CtxMutex

func (*CtxMutex) Lock added in v0.6.2

func (m *CtxMutex) Lock(ctx context.Context) error

func (*CtxMutex) Unlock added in v0.6.2

func (m *CtxMutex) Unlock()

type Serial

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

func (*Serial) Get

func (s *Serial) Get() int

func (*Serial) Incr

func (s *Serial) Incr() int

type Snowflake

type Snowflake int64

func (*Snowflake) Get

func (s *Snowflake) Get() discord.Snowflake

func (*Snowflake) Set

func (s *Snowflake) Set(id discord.Snowflake)

type SnowflakeSet added in v0.9.3

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

func NewSnowflakeSet added in v0.9.3

func NewSnowflakeSet() *SnowflakeSet

NewSnowflakeSet creates a new SnowflakeSet.

func (*SnowflakeSet) Add added in v0.9.3

func (s *SnowflakeSet) Add(flake discord.Snowflake)

Add adds the passed discord.Snowflake to the set.

func (*SnowflakeSet) Contains added in v0.9.3

func (s *SnowflakeSet) Contains(flake discord.Snowflake) (ok bool)

Contains checks whether the passed discord.Snowflake is present in the set.

func (*SnowflakeSet) Delete added in v0.9.3

func (s *SnowflakeSet) Delete(flake discord.Snowflake) bool

Delete deletes the passed discord.Snowflake from the set and returns true if the element is present. If not, Delete is a no-op and returns false.

type String

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

func (*String) Get

func (s *String) Get() string

func (*String) Set

func (s *String) Set(str string)

type Time

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

func Now

func Now() *Time

func (*Time) Get

func (t *Time) Get() time.Time

func (*Time) HasBeen

func (t *Time) HasBeen(dura time.Duration) bool

HasBeen checks if it has been this long since the last time. If yes, it will set the time.

func (*Time) Set

func (t *Time) Set(time time.Time)

Jump to

Keyboard shortcuts

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