cache

package
v0.4.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2022 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountCache

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

AccountCache is a cache wrapper to provide URL and URI lookups for gtsmodel.Account

func NewAccountCache

func NewAccountCache() *AccountCache

NewAccountCache returns a new instantiated AccountCache object

func (*AccountCache) GetByID

func (c *AccountCache) GetByID(id string) (*gtsmodel.Account, bool)

GetByID attempts to fetch a account from the cache by its ID, you will receive a copy for thread-safety

func (*AccountCache) GetByURI

func (c *AccountCache) GetByURI(uri string) (*gtsmodel.Account, bool)

GetByURI attempts to fetch a account from the cache by its URI, you will receive a copy for thread-safety

func (*AccountCache) GetByURL

func (c *AccountCache) GetByURL(url string) (*gtsmodel.Account, bool)

GetByURL attempts to fetch a account from the cache by its URL, you will receive a copy for thread-safety

func (*AccountCache) Put

func (c *AccountCache) Put(account *gtsmodel.Account)

Put places a account in the cache, ensuring that the object place is a copy for thread-safety

type StatusCache

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

StatusCache is a cache wrapper to provide URL and URI lookups for gtsmodel.Status

func NewStatusCache

func NewStatusCache() *StatusCache

NewStatusCache returns a new instantiated statusCache object

func (*StatusCache) GetByID

func (c *StatusCache) GetByID(id string) (*gtsmodel.Status, bool)

GetByID attempts to fetch a status from the cache by its ID, you will receive a copy for thread-safety

func (*StatusCache) GetByURI

func (c *StatusCache) GetByURI(uri string) (*gtsmodel.Status, bool)

GetByURI attempts to fetch a status from the cache by its URI, you will receive a copy for thread-safety

func (*StatusCache) GetByURL

func (c *StatusCache) GetByURL(url string) (*gtsmodel.Status, bool)

GetByURL attempts to fetch a status from the cache by its URL, you will receive a copy for thread-safety

func (*StatusCache) Put

func (c *StatusCache) Put(status *gtsmodel.Status)

Put places a status in the cache, ensuring that the object place is a copy for thread-safety

Jump to

Keyboard shortcuts

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