util

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package util provides the function IsOnlyRead to check sql is only read, and provides a LRUCache.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsOnlyRead

func IsOnlyRead(sql string) bool

IsOnlyRead parse sql is only read

Types

type LRUCache

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

func NewLRUCache

func NewLRUCache(capacity int) *LRUCache

NewLRUCache create a lruCache with input capacity

func (*LRUCache) Get

func (c *LRUCache) Get(key int64) int

Get if key not exist, return -1

func (*LRUCache) Put

func (c *LRUCache) Put(key int64, value int)

Put store key-val in lruCache

Jump to

Keyboard shortcuts

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