cache

package
v0.0.0-...-0316dc9 Latest Latest
Warning

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

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

Documentation

Overview

© 2022 OSINT Fingerprint Project Contributors

© 2022 OSINT Fingerprint Project Contributors

© 2022 OSINT Fingerprint Project Contributors

Index

Constants

View Source
const MEMCACHED_EXPIRATION = (86400 * 7)

7 days cache expiration

View Source
const POSTGRES_EXPIRATION = time.Duration(1) * time.Hour * 24 * 7

7 days cache expiration

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache struct {
	gorm.Model
	CacheTime time.Time
	Category  string `gorm:"index:idx_category_source_key"`
	Source    string `gorm:"index:idx_category_source_key"`
	Key       string `gorm:"index:idx_category_source_key"`
	Json      datatypes.JSON
}

type HybridCache

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

func NewHybridCache

func NewHybridCache() *HybridCache

func (HybridCache) Get

func (x HybridCache) Get(category string, source string, key string) (json.RawMessage, error)

func (HybridCache) Set

func (x HybridCache) Set(category string, source string, key string, json json.RawMessage) error

type Memcached

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

func NewMemcached

func NewMemcached() *Memcached

func (Memcached) Get

func (x Memcached) Get(category string, source string, key string) (json.RawMessage, error)

func (Memcached) GetKey

func (x Memcached) GetKey(category string, source string, key string) string

func (Memcached) Set

func (x Memcached) Set(category string, source string, key string, json json.RawMessage) error

type PostgresCache

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

func NewPostgresCache

func NewPostgresCache() *PostgresCache

func (PostgresCache) Get

func (x PostgresCache) Get(category string, source string, key string) (json.RawMessage, error)

func (PostgresCache) Set

func (x PostgresCache) Set(category string, source string, key string, json json.RawMessage) error

Jump to

Keyboard shortcuts

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