cache_config

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2023 License: Apache-2.0 Imports: 2 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

配置信息缓存的性能优化版本,无锁访问, array存储

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Arrays

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

Array cache

func (*Arrays) Commit

func (s *Arrays) Commit()

func (*Arrays) Find

func (s *Arrays) Find(id int) ([]int64, bool)

func (*Arrays) Init

func (s *Arrays) Init(item_count int) *Arrays

func (*Arrays) Read

func (s *Arrays) Read(id int, default_value []int64) []int64

func (*Arrays) Update

func (s *Arrays) Update(id int, value []int64) bool

type Bools

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

boolean cache

func (*Bools) Commit

func (s *Bools) Commit()

func (*Bools) Find

func (s *Bools) Find(id int) (bool, bool)

func (*Bools) Init

func (s *Bools) Init(item_count int) *Bools

func (*Bools) Read

func (s *Bools) Read(id int, default_value bool) bool

func (*Bools) Update

func (s *Bools) Update(id int, value bool) bool

type Configuration

type Configuration struct {
	CStrings  Strings
	CBools    Bools
	CIntegers Integers
}

func (*Configuration) Commit

func (c *Configuration) Commit()

func (*Configuration) Init

func (c *Configuration) Init(stringMax, boolMax, integerMax int)

func (*Configuration) Update

func (c *Configuration) Update(strings, bools, integers map[string]int, key string, value interface{}) bool

type Integers

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

integer cache

func (*Integers) Commit

func (s *Integers) Commit()

func (*Integers) Find

func (s *Integers) Find(id int) (int64, bool)

func (*Integers) Init

func (s *Integers) Init(item_count int) *Integers

func (*Integers) Read

func (s *Integers) Read(id int, default_value int64) int64

func (*Integers) Update

func (s *Integers) Update(id int, value int64) bool

type Strings

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

string cache

func (*Strings) Commit

func (s *Strings) Commit()

func (*Strings) Find

func (s *Strings) Find(id int) (string, bool)

func (*Strings) Init

func (s *Strings) Init(item_count int) *Strings

func (*Strings) Read

func (s *Strings) Read(id int, default_value string) string

func (*Strings) Update

func (s *Strings) Update(id int, value string) bool

Jump to

Keyboard shortcuts

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