ignorelist

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: May 7, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package ignorelist is an ignore list specific redis implementation and will be removed in a future version.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Ignorelists are modeled in redis as sorted sets. Participant IDs are the elements, and the values are the epoch timestamp in seconds of when the element was added to the list.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

func Add(redisConn redis.Conn, ignorelistID string, playerIDs []string) error

Add is an alias for Create() in this implementation

func Create

func Create(redisConn redis.Conn, ignorelistID string, playerIDs []string) error

Create generates an ignorelist in redis by ZADD'ing elements with a score of the current time in seconds since the epoch

func Move

func Move(ctx context.Context, pool *redis.Pool, playerIDs []string, src string, dest string) error

Move moves a list of players from one ignorelist to another. TODO: Make cancellable with context

func Remove

func Remove(redisConn redis.Conn, ignorelistID string, playerIDs []string) error

Remove deletes playerIDs from an ignorelist.

func Retrieve

func Retrieve(redisConn redis.Conn, cfg config.View, il string) ([]string, error)

Retrieve returns a list of playerIDs in the ignorelist 'cfg' is a sub-tree of the config file with just the parameters for this ignorelist.

func SendAdd

func SendAdd(redisConn redis.Conn, ignorelistID string, playerIDs []string)

SendAdd is identical to Add only does a redigo 'Send' as part of a MULTI command.

func SendRemove

func SendRemove(redisConn redis.Conn, ignorelistID string, playerIDs []string)

SendRemove is identical to Remove only does a redigo 'Send' as part of a MULTI command.

Types

This section is empty.

Jump to

Keyboard shortcuts

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