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: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Clean

func Clean(c *hermes.Cache) func(ctx *fiber.Ctx) error

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

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

Returns:

  • func(ctx *fiber.Ctx) error: A fiber context handler function that cleans the regular cache and returns a success message.

func Delete

func Delete(c *hermes.Cache) func(ctx *fiber.Ctx) error

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

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

Returns:

  • func(ctx *fiber.Ctx) error: A fiber context handler function that deletes a key from the cache and returns a success message or an error message if the key is not provided.

func Exists

func Exists(c *hermes.Cache) func(ctx *fiber.Ctx) error

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

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

Returns:

  • func(ctx *fiber.Ctx) error: A fiber context handler function that checks if a key exists in the cache and returns a success message with a boolean value indicating whether the key exists or an error message if the key is not provided.

func FTClean

func FTClean(c *hermes.Cache) func(ctx *fiber.Ctx) error

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

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

Returns:

  • func(ctx *fiber.Ctx) error: A fiber context handler function that cleans the full-text cache and returns a success message or an error message if the cleaning fails.

func FTInit

func FTInit(c *hermes.Cache) func(ctx *fiber.Ctx) error

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

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

Returns:

  • func(ctx *fiber.Ctx) error: A fiber context handler function that initializes the full-text search cache using the max length, max bytes, and min word length parameters provided in the query string and returns a success message or an error message if the parameters are not provided or if the initialization fails.

func FTInitJson

func FTInitJson(c *hermes.Cache) func(ctx *fiber.Ctx) error

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

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

Returns:

  • func(ctx *fiber.Ctx) error: A fiber context handler function that initializes the full-text search cache using a JSON object, max length, max bytes, and min word length parameters provided in the query string and returns a success message or an error message if the parameters are not provided or if the initialization fails.

func FTIsInitialized

func FTIsInitialized(c *hermes.Cache) func(ctx *fiber.Ctx) error

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

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

Returns:

  • func(ctx *fiber.Ctx) error: A fiber context handler function that checks if the full-text search is initialized and returns a success message with a boolean value indicating whether it is initialized.

func FTSequenceIndices

func FTSequenceIndices(c *hermes.Cache) func(ctx *fiber.Ctx) error

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

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

Returns:

  • func(ctx *fiber.Ctx) error: A fiber context handler function that sequences the full-text storage indices and returns a success message or an error message if the sequencing fails.

func FTSetMaxBytes

func FTSetMaxBytes(c *hermes.Cache) func(ctx *fiber.Ctx) error

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

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

Returns:

  • func(ctx *fiber.Ctx) error: A fiber context handler function that sets the maximum number of bytes for full-text search and returns a success message or an error message if the value is not provided or if the setting fails.

func FTSetMaxSize

func FTSetMaxSize(c *hermes.Cache) func(ctx *fiber.Ctx) error

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

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

Returns:

  • func(ctx *fiber.Ctx) error: A fiber context handler function that sets the maximum length for full-text search and returns a success message or an error message if the value is not provided or if the setting fails.

func FTSetMinWordLength

func FTSetMinWordLength(c *hermes.Cache) func(ctx *fiber.Ctx) error

FTSetMinWordLength is a handler function that returns a fiber context handler function for setting the minimum word length for full-text search. Parameters:

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

Returns:

  • func(ctx *fiber.Ctx) error: A fiber context handler function that sets the minimum word length for full-text search and returns a success message or an error message if the value is not provided or if the setting fails.

func FTStorage

func FTStorage(c *hermes.Cache) func(ctx *fiber.Ctx) error

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

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

Returns:

  • func(ctx *fiber.Ctx) error: A fiber context handler function that gets the full-text storage and returns a JSON-encoded string of the data or an error message if the retrieval or encoding fails.

func FTStorageLength

func FTStorageLength(c *hermes.Cache) func(ctx *fiber.Ctx) error

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

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

Returns:

  • func(ctx *fiber.Ctx) error: A fiber context handler function that gets the length of the full-text storage and returns a success message with the length or an error message if the retrieval fails.

func FTStorageSize

func FTStorageSize(c *hermes.Cache) func(ctx *fiber.Ctx) error

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

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

Returns:

  • func(ctx *fiber.Ctx) error: A fiber context handler function that gets the size of the full-text storage and returns a success message with the size or an error message if the retrieval fails.

func Get

func Get(c *hermes.Cache) func(ctx *fiber.Ctx) error

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

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

Returns:

  • func(ctx *fiber.Ctx) error: A fiber context handler function that gets a value from the cache using a key provided in the query string and returns a JSON-encoded string of the value or an error message if the key is not provided or if the retrieval or encoding fails.

func GetAll

func GetAll(c *hermes.Cache) func(ctx *fiber.Ctx) error

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

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

Returns:

  • func(ctx *fiber.Ctx) error: A fiber context handler function that gets all the data from the cache and returns a success message with a JSON-encoded string of the data or an error message if the retrieval or encoding fails.

func Info

func Info(c *hermes.Cache) func(ctx *fiber.Ctx) error

Info is a function that returns information about the cache.

Parameters:

  • c: A pointer to a hermes.Cache struct representing the cache to get information from.

Returns:

  • A function that takes a pointer to a fiber.Ctx struct and returns an error. The function returns information about the cache.

func InfoForTesting

func InfoForTesting(c *hermes.Cache) func(ctx *fiber.Ctx) error

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

Parameters:

  • c: A pointer to a hermes.Cache struct representing the cache to get information from.

Returns:

  • A function that takes a pointer to a fiber.Ctx struct and returns an error. The function returns information about the cache for testing purposes.

func Keys

func Keys(c *hermes.Cache) func(ctx *fiber.Ctx) error

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

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

Returns:

  • func(ctx *fiber.Ctx) error: A fiber context handler function that gets all the keys from the cache and returns a JSON-encoded string of the keys or an error message if the retrieval or encoding fails.

func Length

func Length(c *hermes.Cache) func(ctx *fiber.Ctx) error

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

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

Returns:

  • func(ctx *fiber.Ctx) error: A fiber context handler function that gets the length of the cache and returns a success message with the length or an error message if the retrieval fails.
func Search(c *hermes.Cache) func(ctx *fiber.Ctx) error

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

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

Returns:

  • func(ctx *fiber.Ctx) error: A fiber context handler function that searches the cache using the query, limit, strict, and schema parameters provided in the query string and returns a JSON-encoded string of the search results or an error message if the search fails or if the parameters are not provided.

func SearchOneWord

func SearchOneWord(c *hermes.Cache) func(ctx *fiber.Ctx) error

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

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

Returns:

  • func(ctx *fiber.Ctx) error: A fiber context handler function that searches the cache for a single word using the query, limit, and strict parameters provided in the query string and returns a JSON-encoded string of the search results or an error message if the search fails or if the parameters are not provided.

func SearchValues

func SearchValues(c *hermes.Cache) func(ctx *fiber.Ctx) error

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

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

Returns:

  • func(ctx *fiber.Ctx) error: A fiber context handler function that searches the cache for values using the query, limit, and schema parameters provided in the query string and returns a JSON-encoded string of the search results or an error message if the search fails or if the parameters are not provided.

func SearchWithKey

func SearchWithKey(c *hermes.Cache) func(ctx *fiber.Ctx) error

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

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

Returns:

  • func(ctx *fiber.Ctx) error: A fiber context handler function that searches the cache with a specific key using the query and limit parameters provided in the query string and returns a JSON-encoded string of the search results or an error message if the search fails or if the parameters are not provided.

func Set

func Set(c *hermes.Cache) func(ctx *fiber.Ctx) error

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

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

Returns:

  • func(ctx *fiber.Ctx) error: A fiber context handler function that sets a value in the cache using the key and value parameters provided in the query string and returns a success message or an error message if the set fails or if the parameters are not provided.

func Values

func Values(c *hermes.Cache) func(ctx *fiber.Ctx) error

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

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

Returns:

  • func(ctx *fiber.Ctx) error: A fiber context handler function that gets all values from the cache and returns a JSON-encoded string of the values 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