cache

package
v3.7.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CacheService

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

func NewCacheService

func NewCacheService(token string) *CacheService

func (*CacheService) Decrement

func (t *CacheService) Decrement(request *DecrementRequest) (*DecrementResponse, error)

Decrement a value (if it's a number)

func (*CacheService) Delete

func (t *CacheService) Delete(request *DeleteRequest) (*DeleteResponse, error)

Delete a value from the cache

func (*CacheService) Get

func (t *CacheService) Get(request *GetRequest) (*GetResponse, error)

Get an item from the cache by key

func (*CacheService) Increment

func (t *CacheService) Increment(request *IncrementRequest) (*IncrementResponse, error)

Increment a value (if it's a number)

func (*CacheService) Set

func (t *CacheService) Set(request *SetRequest) (*SetResponse, error)

Set an item in the cache. Overwrites any existing value already set.

type DecrementRequest

type DecrementRequest struct {
	// The key to decrement
	Key string `json:"key"`
	// The amount to decrement the value by
	Value int64 `json:"value,string"`
}

type DecrementResponse

type DecrementResponse struct {
	// The key decremented
	Key string `json:"key"`
	// The new value
	Value int64 `json:"value,string"`
}

type DeleteRequest

type DeleteRequest struct {
	// The key to delete
	Key string `json:"key"`
}

type DeleteResponse

type DeleteResponse struct {
	// Returns "ok" if successful
	Status string `json:"status"`
}

type GetRequest

type GetRequest struct {
	// The key to retrieve
	Key string `json:"key"`
}

type GetResponse

type GetResponse struct {
	// The key
	Key string `json:"key"`
	// Time to live in seconds
	Ttl int64 `json:"ttl,string"`
	// The value
	Value string `json:"value"`
}

type IncrementRequest

type IncrementRequest struct {
	// The key to increment
	Key string `json:"key"`
	// The amount to increment the value by
	Value int64 `json:"value,string"`
}

type IncrementResponse

type IncrementResponse struct {
	// The key incremented
	Key string `json:"key"`
	// The new value
	Value int64 `json:"value,string"`
}

type SetRequest

type SetRequest struct {
	// The key to update
	Key string `json:"key"`
	// Time to live in seconds
	Ttl int64 `json:"ttl,string"`
	// The value to set
	Value string `json:"value"`
}

type SetResponse

type SetResponse struct {
	// Returns "ok" if successful
	Status string `json:"status"`
}

Jump to

Keyboard shortcuts

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