bouncer/internal/queue/repository.go

17 lines
671 B
Go

package queue
import "context"
type Repository interface {
CreateQueue(ctx context.Context, name string, capacity int) error
GetQueue(ctx context.Context, name string) (int, int, error)
UpdateQueue(ctx context.Context, name string, capacity int) error
DeleteQueue(ctx context.Context, name string) error
RefreshQueue(ctx context.Context, name string) (int, int, error)
CreateToken(ctx context.Context, name string) (string, int, error)
GetTokenPosition(ctx context.Context, name string, token string) (int, int, error)
TouchToken(ctx context.Context, name string, token string) (int, error)
RemoveToken(ctx context.Context, name string, token string) error
}