common

package
v0.0.0-...-7f9e108 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2022 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetOne

func GetOne(children map[string]*TrieNode, pre string) []model.Node

func GetSSHClient

func GetSSHClient(user, pass, addr string) (*ssh.Client, error)

func NewLogger

func NewLogger(logPath string) *zap.Logger

NewLogger new zap logger instance

Types

type RedisLog

type RedisLog struct {
	Logger *zap.Logger
}

func (RedisLog) AfterProcess

func (rl RedisLog) AfterProcess(ctx context.Context, cmd redis.Cmder) error

func (RedisLog) AfterProcessPipeline

func (rl RedisLog) AfterProcessPipeline(ctx context.Context, cmd []redis.Cmder) error

func (RedisLog) BeforeProcess

func (rl RedisLog) BeforeProcess(ctx context.Context, cmd redis.Cmder) (context.Context, error)

func (RedisLog) BeforeProcessPipeline

func (rl RedisLog) BeforeProcessPipeline(ctx context.Context, cmd []redis.Cmder) (context.Context, error)

type StorageGRM

type StorageGRM struct {
	GRMFile string
}

func NewStorageGRM

func NewStorageGRM(dir string) *StorageGRM

func (*StorageGRM) ReadData

func (s *StorageGRM) ReadData() ([]byte, error)

func (*StorageGRM) WriteData

func (s *StorageGRM) WriteData(data []byte) error

type Tire

type Tire struct {
	Root *TrieNode
}

func NewTire

func NewTire() *Tire

NewTire 构造字典树

func (*Tire) Insert

func (t *Tire) Insert(word string)

Insert 向字典树中插入单词

type TrieNode

type TrieNode struct {
	Children map[string]*TrieNode
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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