mem

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Item

type Item struct {
	Datemake   time.Time
	Dateupdate time.Time
	Key        string
	Value      interface{}
	// contains filtered or unexported fields
}

Item struct to use in cache

func NewItem added in v0.0.2

func NewItem(key string, value interface{}) *Item

NewItem create new item

func (*Item) ArrayBool

func (i *Item) ArrayBool() []bool

Return value array from item

func (*Item) ArrayDuration

func (i *Item) ArrayDuration() []time.Duration

Return value array from item

func (*Item) ArrayFloat

func (i *Item) ArrayFloat() []float64

Return value array from item

func (*Item) ArrayInt

func (i *Item) ArrayInt() []int

Return value array from item

func (*Item) ArrayJson

func (i *Item) ArrayJson() []et.Json

Return value array from item

func (*Item) ArrayMap

func (i *Item) ArrayMap() []map[string]interface{}

Return value array from item

func (*Item) ArrayStr

func (i *Item) ArrayStr() []string

Return value array from item

func (*Item) ArrayTime

func (i *Item) ArrayTime() []time.Time

Return value array from item

func (*Item) Bool

func (i *Item) Bool() bool

Return value bool from item

func (*Item) Duration

func (i *Item) Duration() time.Duration

Return value duration from item

func (*Item) Float

func (i *Item) Float() float64

Return value float from item

func (*Item) Get

func (i *Item) Get() interface{}

Get method to use in item

func (*Item) Int

func (i *Item) Int() int

Return value int from item

func (*Item) Json

func (i *Item) Json() et.Json

Return value json from item

func (*Item) Map

func (i *Item) Map() map[string]interface{}

Return value map from item

func (*Item) Set

func (i *Item) Set(value interface{}) interface{}

Set method to use in item

func (*Item) Str

func (i *Item) Str() string

Return value string from item

func (*Item) Time

func (i *Item) Time() time.Time

Return value time from item

type Mem

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

Mem struct to use in gateway

func Load

func Load() (*Mem, error)

NewCache create new cache

func (*Mem) Clear

func (c *Mem) Clear()

Clear method to use in cache

func (*Mem) Count added in v0.0.2

func (c *Mem) Count(key string, expiration time.Duration) int

func (*Mem) Del

func (c *Mem) Del(key string) bool

Del method to use in cache

func (*Mem) Get

func (c *Mem) Get(key string, def interface{}) interface{}

Get method to use in cache

func (*Mem) Keys

func (c *Mem) Keys() []string

Keys method to use in cache

func (*Mem) Len

func (c *Mem) Len() int

Len method to use in cache

func (*Mem) Set

func (c *Mem) Set(key string, value interface{}, expiration time.Duration) interface{}

Set method to use in cache

func (*Mem) Type

func (c *Mem) Type() string

Type method to use in cache

func (*Mem) Values

func (c *Mem) Values() []interface{}

Values method to use in cache

type Peticiones

type Peticiones struct {

	//
	Peticiones int
	//
	Capacity  int // Capacidad de peticiones del ACS
	TimeWait  int // Tiempo de espera para la siguiente petición
	SizeStack int // Tamaño de la pila de peticiones
	// contains filtered or unexported fields
}

func NewPetciones added in v0.0.2

func NewPetciones(capacity, timeWait int) *Peticiones

func (*Peticiones) Ejecucion

func (c *Peticiones) Ejecucion(executeFc func(params et.Json) (et.Items, error), params et.Json) (et.Items, error)

func (*Peticiones) GetConfig

func (c *Peticiones) GetConfig() et.Json

func (*Peticiones) GetPeticiones

func (c *Peticiones) GetPeticiones() int

Jump to

Keyboard shortcuts

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