handlers

package
v0.7.17 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Clean

func Clean(_ *utils.Params, c *hermes.Cache) []byte

Clean is a handler function that returns a fiber context handler function for cleaning the cache. Parameters:

  • _ (*utils.Params): A pointer to a utils.Params struct (unused).
  • c (*hermes.Cache): A pointer to a hermes.Cache struct.

Returns:

  • []byte: A JSON-encoded byte slice containing a success message or an error message if the cleaning fails.

func Delete

func Delete(p *utils.Params, c *hermes.Cache) []byte

Delete is a handler function that returns a fiber context handler function for deleting a key from the cache. Parameters:

  • p (*utils.Params): A pointer to a utils.Params struct.
  • c (*hermes.Cache): A pointer to a hermes.Cache struct.

Returns:

  • []byte: A JSON-encoded byte slice containing a success message or an error message if the key is not provided or the deletion fails.

func Exists

func Exists(p *utils.Params, c *hermes.Cache) []byte

Exists is a handler function that returns a fiber context handler function for checking if a key exists in the cache. Parameters:

  • p (*utils.Params): A pointer to a utils.Params struct.
  • c (*hermes.Cache): A pointer to a hermes.Cache struct.

Returns:

  • []byte: A JSON-encoded byte slice containing a boolean value indicating whether the key exists in the cache or an error message if the key is not provided.

func FTClean

func FTClean(_ *utils.Params, c *hermes.Cache) []byte

FTClean is a handler function that returns a fiber context handler function for cleaning the full-text storage. Parameters:

  • _ (*utils.Params): A pointer to a utils.Params struct (unused).
  • c (*hermes.Cache): A pointer to a hermes.Cache struct.

Returns:

  • []byte: A JSON-encoded byte slice containing a success message or an error message if the cleaning fails.

func FTInit

func FTInit(p *utils.Params, c *hermes.Cache) []byte

FTInit is a handler function that returns a fiber context handler function for initializing the full-text search cache. Parameters:

  • p (*utils.Params): A pointer to a utils.Params struct.
  • c (*hermes.Cache): A pointer to a hermes.Cache struct.

Returns:

  • []byte: A JSON-encoded byte slice containing a success message or an error message if the initialization fails.

func FTInitJson

func FTInitJson(p *utils.Params, c *hermes.Cache) []byte

FTInitJson is a handler function that returns a fiber context handler function for initializing the full-text search cache with a JSON object. Parameters:

  • p (*utils.Params): A pointer to a utils.Params struct.
  • c (*hermes.Cache): A pointer to a hermes.Cache struct.

Returns:

  • []byte: A JSON-encoded byte slice containing a success message or an error message if the initialization fails.

func FTIsInitialized

func FTIsInitialized(_ *utils.Params, c *hermes.Cache) []byte

FTIsInitialized is a handler function that returns a fiber context handler function for checking if the full-text storage is initialized. Parameters:

  • _ (*utils.Params): A pointer to a utils.Params struct (unused).
  • c (*hermes.Cache): A pointer to a hermes.Cache struct.

Returns:

  • []byte: A JSON-encoded byte slice containing a boolean value indicating whether the full-text storage is initialized.

func FTSequenceIndices

func FTSequenceIndices(_ *utils.Params, c *hermes.Cache) []byte

FTSequenceIndices is a handler function that returns a fiber context handler function for sequencing the full-text storage indices. Parameters:

  • _ (*utils.Params): A pointer to a utils.Params struct (unused).
  • c (*hermes.Cache): A pointer to a hermes.Cache struct.

Returns:

  • []byte: A JSON-encoded byte slice containing a success message or an error message if the sequencing fails.

func FTSetMaxBytes

func FTSetMaxBytes(p *utils.Params, c *hermes.Cache) []byte

FTSetMaxBytes is a handler function that returns a fiber context handler function for setting the maximum number of bytes for the full-text storage. Parameters:

  • p (*utils.Params): A pointer to a utils.Params struct.
  • c (*hermes.Cache): A pointer to a hermes.Cache struct.

Returns:

  • []byte: A JSON-encoded byte slice containing a success message or an error message if the value is invalid or the setting fails.

func FTSetMaxSize

func FTSetMaxSize(p *utils.Params, c *hermes.Cache) []byte

FTSetMaxSize is a handler function that returns a fiber context handler function for setting the maximum length for the full-text storage. Parameters:

  • p (*utils.Params): A pointer to a utils.Params struct.
  • c (*hermes.Cache): A pointer to a hermes.Cache struct.

Returns:

  • []byte: A JSON-encoded byte slice containing a success message or an error message if the value is invalid or the setting fails.

func FTStorage

func FTStorage(_ *utils.Params, c *hermes.Cache) []byte

FTStorage is a handler function that returns a fiber context handler function for retrieving the full-text storage. Parameters:

  • _ (*utils.Params): A pointer to a utils.Params struct (unused).
  • c (*hermes.Cache): A pointer to a hermes.Cache struct.

Returns:

  • []byte: A JSON-encoded byte slice containing the full-text storage or an error message if the retrieval fails.

func FTStorageLength

func FTStorageLength(_ *utils.Params, c *hermes.Cache) []byte

FTStorageLength is a handler function that returns a fiber context handler function for retrieving the length of the full-text storage. Parameters:

  • _ (*utils.Params): A pointer to a utils.Params struct (unused).
  • c (*hermes.Cache): A pointer to a hermes.Cache struct.

Returns:

  • []byte: A JSON-encoded byte slice containing the length of the full-text storage or an error message if the retrieval fails.

func FTStorageSize

func FTStorageSize(_ *utils.Params, c *hermes.Cache) []byte

FTStorageSize is a handler function that returns a fiber context handler function for retrieving the size of the full-text storage. Parameters:

  • _ (*utils.Params): A pointer to a utils.Params struct (unused).
  • c (*hermes.Cache): A pointer to a hermes.Cache struct.

Returns:

  • []byte: A JSON-encoded byte slice containing the size of the full-text storage or an error message if the retrieval fails.

func Get

func Get(p *utils.Params, c *hermes.Cache) []byte

Get is a handler function that returns a fiber context handler function for retrieving a key from the cache. Parameters:

  • p (*utils.Params): A pointer to a utils.Params struct.
  • c (*hermes.Cache): A pointer to a hermes.Cache struct.

Returns:

  • []byte: A JSON-encoded byte slice containing the value of the key or an error message if the key is not provided or the retrieval fails.

func GetAll

func GetAll(_ *utils.Params, c *hermes.Cache) []byte

GetAll is a handler function that returns a fiber context handler function for retrieving all data from the cache. Parameters:

  • _ (*utils.Params): A pointer to a utils.Params struct (unused).
  • c (*hermes.Cache): A pointer to a hermes.Cache struct.

Returns:

  • []byte: A JSON-encoded byte slice containing all data from the cache or an error message if the retrieval fails.

func Info

func Info(_ *utils.Params, c *hermes.Cache) []byte

Info is a function that returns information about the cache.

Parameters:

  • _ : A pointer to a utils.Params struct representing the parameters of the request. This parameter is ignored.
  • c: A pointer to a hermes.Cache struct representing the cache to get information from.

Returns:

  • A byte slice representing the information about the cache.

func InfoForTesting

func InfoForTesting(_ *utils.Params, c *hermes.Cache) []byte

InfoForTesting is a function that returns information about the cache for testing purposes.

Parameters:

  • _ : A pointer to a utils.Params struct representing the parameters of the request. This parameter is ignored.
  • c: A pointer to a hermes.Cache struct representing the cache to get information from.

Returns:

  • A byte slice representing the information about the cache for testing purposes.

func Keys

func Keys(_ *utils.Params, c *hermes.Cache) []byte

Keys is a handler function that returns a fiber context handler function for retrieving all keys from the cache. Parameters:

  • _ (*utils.Params): A pointer to a utils.Params struct (unused).
  • c (*hermes.Cache): A pointer to a hermes.Cache struct.

Returns:

  • []byte: A JSON-encoded byte slice containing all keys from the cache or an error message if the retrieval fails.

func Length

func Length(_ *utils.Params, c *hermes.Cache) []byte

Length is a handler function that returns a fiber context handler function for retrieving the length of the cache. Parameters:

  • _ (*utils.Params): A pointer to a utils.Params struct (unused).
  • c (*hermes.Cache): A pointer to a hermes.Cache struct.

Returns:

  • []byte: A JSON-encoded byte slice containing the length of the cache.
func Search(p *utils.Params, c *hermes.Cache) []byte

Search is a handler function that returns a fiber context handler function for searching the cache for a query. Parameters:

  • p (*utils.Params): A pointer to a utils.Params struct.
  • c (*hermes.Cache): A pointer to a hermes.Cache struct.

Returns:

  • []byte: A JSON-encoded byte slice containing the search results or an error message if the search fails.

func SearchOneWord

func SearchOneWord(p *utils.Params, c *hermes.Cache) []byte

SearchOneWord is a handler function that returns a fiber context handler function for searching the cache for a single word query. Parameters:

  • p (*utils.Params): A pointer to a utils.Params struct.
  • c (*hermes.Cache): A pointer to a hermes.Cache struct.

Returns:

  • []byte: A JSON-encoded byte slice containing the search results or an error message if the search fails.

func SearchValues

func SearchValues(p *utils.Params, c *hermes.Cache) []byte

SearchValues is a handler function that returns a fiber context handler function for searching the cache for a query in values. Parameters:

  • p (*utils.Params): A pointer to a utils.Params struct.
  • c (*hermes.Cache): A pointer to a hermes.Cache struct.

Returns:

  • []byte: A JSON-encoded byte slice containing the search results or an error message if the search fails.

func SearchWithKey

func SearchWithKey(p *utils.Params, c *hermes.Cache) []byte

SearchWithKey is a handler function that returns a fiber context handler function for searching the cache for a query with a specific key. Parameters:

  • p (*utils.Params): A pointer to a utils.Params struct.
  • c (*hermes.Cache): A pointer to a hermes.Cache struct.

Returns:

  • []byte: A JSON-encoded byte slice containing the search results or an error message if the search fails.

func Set

func Set(p *utils.Params, c *hermes.Cache) []byte

Set is a handler function that returns a fiber context handler function for setting a value in the cache. Parameters:

  • p (*utils.Params): A pointer to a utils.Params struct.
  • c (*hermes.Cache): A pointer to a hermes.Cache struct.

Returns:

  • []byte: A JSON-encoded byte slice containing a success message or an error message if the set operation fails.

func Values

func Values(_ *utils.Params, c *hermes.Cache) []byte

Values is a handler function that returns a fiber context handler function for retrieving all values from the cache. Parameters:

  • _ (*utils.Params): A pointer to a utils.Params struct (unused).
  • c (*hermes.Cache): A pointer to a hermes.Cache struct.

Returns:

  • []byte: A JSON-encoded byte slice containing all values from the cache or an error message if the retrieval fails.

Types

This section is empty.

Jump to

Keyboard shortcuts

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