imp

package
v0.0.0-...-a427546 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mutex

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

func NewMutex

func NewMutex() *Mutex

func (*Mutex) AcquireLock

func (m *Mutex) AcquireLock(ctx context.Context) (lockId string, err error)

func (*Mutex) ReleaseLock

func (m *Mutex) ReleaseLock(ctx context.Context, id string) (err error)

type PushRedisRepo

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

func NewPushRedisRepo

func NewPushRedisRepo() *PushRedisRepo

func (*PushRedisRepo) GetPushs

func (p *PushRedisRepo) GetPushs(ctx context.Context, uid string, count int) (msgs []string, err error)

func (*PushRedisRepo) SendPush

func (p *PushRedisRepo) SendPush(ctx context.Context, uid string, message string) error

type RedisCounter

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

func NewRedisCounter

func NewRedisCounter() *RedisCounter

func (*RedisCounter) GetCounter

func (c *RedisCounter) GetCounter(name string, perci int)

func (*RedisCounter) UpdateCounter

func (c *RedisCounter) UpdateCounter(name string, count int64)

type Semaphor

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

func NewSemaphor

func NewSemaphor(count int) *Semaphor

func (*Semaphor) AcquireLock

func (s *Semaphor) AcquireLock(ctx context.Context) error

func (*Semaphor) ReleaseLock

func (s *Semaphor) ReleaseLock(ctx context.Context) error

type Widget

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

func NewWidget

func NewWidget() *Widget

func (*Widget) GetWidgets

func (w *Widget) GetWidgets(ctx context.Context, uid string, count int) (widgets []WidgetModel, err error)

func (*Widget) SendWidget

func (w *Widget) SendWidget(ctx context.Context, widget *WidgetModel) (err error)

type WidgetModel

type WidgetModel struct {
	UserId   string `json:"uid"`
	Priority int    `json:"im"`
	Message  string `json:"msg"`
}

func FromString

func FromString(v string) *WidgetModel

func (*WidgetModel) MarshalString

func (w *WidgetModel) MarshalString() string

Jump to

Keyboard shortcuts

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