github.com/gogf/gf/v2@v2.7.4/database/gredis/gredis_redis_group_list.go (about)

     1  // Copyright GoFrame Author(https://goframe.org). All Rights Reserved.
     2  //
     3  // This Source Code Form is subject to the terms of the MIT License.
     4  // If a copy of the MIT was not distributed with this file,
     5  // You can obtain one at https://github.com/gogf/gf.
     6  
     7  package gredis
     8  
     9  import (
    10  	"context"
    11  
    12  	"github.com/gogf/gf/v2/container/gvar"
    13  )
    14  
    15  // IGroupList manages redis list operations.
    16  // Implements see redis.GroupList.
    17  type IGroupList interface {
    18  	LPush(ctx context.Context, key string, values ...interface{}) (int64, error)
    19  	LPushX(ctx context.Context, key string, element interface{}, elements ...interface{}) (int64, error)
    20  	RPush(ctx context.Context, key string, values ...interface{}) (int64, error)
    21  	RPushX(ctx context.Context, key string, value interface{}) (int64, error)
    22  	LPop(ctx context.Context, key string, count ...int) (*gvar.Var, error)
    23  	RPop(ctx context.Context, key string, count ...int) (*gvar.Var, error)
    24  	LRem(ctx context.Context, key string, count int64, value interface{}) (int64, error)
    25  	LLen(ctx context.Context, key string) (int64, error)
    26  	LIndex(ctx context.Context, key string, index int64) (*gvar.Var, error)
    27  	LInsert(ctx context.Context, key string, op LInsertOp, pivot, value interface{}) (int64, error)
    28  	LSet(ctx context.Context, key string, index int64, value interface{}) (*gvar.Var, error)
    29  	LRange(ctx context.Context, key string, start, stop int64) (gvar.Vars, error)
    30  	LTrim(ctx context.Context, key string, start, stop int64) error
    31  	BLPop(ctx context.Context, timeout int64, keys ...string) (gvar.Vars, error)
    32  	BRPop(ctx context.Context, timeout int64, keys ...string) (gvar.Vars, error)
    33  	RPopLPush(ctx context.Context, source, destination string) (*gvar.Var, error)
    34  	BRPopLPush(ctx context.Context, source, destination string, timeout int64) (*gvar.Var, error)
    35  }
    36  
    37  // LInsertOp defines the operation name for function LInsert.
    38  type LInsertOp string
    39  
    40  const (
    41  	LInsertBefore LInsertOp = "BEFORE"
    42  	LInsertAfter  LInsertOp = "AFTER"
    43  )