sbckey

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConsulDefaultKeyBuilder

func ConsulDefaultKeyBuilder[T comparable]() sbc.KeyBuilder[T]

ConsulDefaultKeyBuilder is a function that returns a key builder for Consul. It builds a key based on a value of a comparable type T. The built key is generated by formatting the value's type as a string and removing the leading slash if present.

Example usage:

builder := ConsulDefaultKeyBuilder[int]()
key := builder.BuildKey(42) // key = "int"

func DefaultKeyBuilder

func DefaultKeyBuilder[T comparable]() sbc.KeyBuilder[T]

DefaultKeyBuilder returns a KeyBuilder function that formats the type of the input value as a string.

func NatsDefaultKeyBuilder

func NatsDefaultKeyBuilder[T comparable]() sbc.KeyBuilder[T]

NatsDefaultKeyBuilder returns a KeyBuilder function that formats the type of the input value as a string. NATS key should be aligned to following naming convention https://docs.nats.io/nats-concepts/subjects#characters-allowed-for-subject-names

Allowed characters Any ASCII character except null and .,* and > Recommended characters: a to z, A to Z and 0 to 9 and - (names are case-sensitive, and cannot contain whitespace).

Types

This section is empty.

Jump to

Keyboard shortcuts

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