Documentation
¶
Index ¶
Constants ¶
View Source
const ( PetNameDefaultPrefix = "" PetNameDefaultSegments = 3 PetNameDefaultSeparator = "-" )
View Source
const ( RandomB64DefaultMinSize = 64 RandomB64DefaultMaxSize = 1024 )
View Source
const (
DefaultNumEntries = 1024
)
Variables ¶
View Source
var ( DefaultKeyGenerator = generators.PetNameGenerator("", 3, "-") DefaultValueGenerator = generators.RandomB64Generator(64, 1024) )
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { NumEntries int KeyGen generators.StringGenerator ValueGen generators.StringGenerator }
Config is all the configuration necessary for creating KV data
func DefaultConfig ¶
func DefaultConfig() Config
DefaultConfig returns a config with all the defaults filled in.
type KV ¶
KV is the output format of the generated KV data before serializing to JSON. This will result in a JSON object that looks like the following:
{ "<key 1>": { "Value": "<data>", "Namespace": "<optional>", "Datacenter": "<optional>", "Token": "<optional>", "Flags": <optional - uint>, }, ... }
All fields of each object may be omitted if they are empty except for the `Value` field
type KeyType ¶
type KeyType string
const ( KeyTypePetName KeyType = "pet-name" DefaultKeyType = KeyTypePetName )
type PetNameUserConfig ¶
func DefaultPetNameUserConfig ¶
func DefaultPetNameUserConfig() PetNameUserConfig
func (*PetNameUserConfig) Generator ¶
func (c *PetNameUserConfig) Generator() generators.StringGenerator
func (*PetNameUserConfig) Normalize ¶
func (c *PetNameUserConfig) Normalize()
type RandomB64UserConfig ¶
func DefaultRandomB64UserConfig ¶
func DefaultRandomB64UserConfig() RandomB64UserConfig
func (*RandomB64UserConfig) Generator ¶
func (c *RandomB64UserConfig) Generator() generators.StringGenerator
func (*RandomB64UserConfig) Normalize ¶
func (c *RandomB64UserConfig) Normalize()
type UserConfig ¶
type UserConfig struct { NumEntries int KeyType KeyType ValueType ValueType PetName PetNameUserConfig RandomB64 RandomB64UserConfig }
func DefaultUserConfig ¶
func DefaultUserConfig() UserConfig
func (*UserConfig) Normalize ¶
func (c *UserConfig) Normalize()
func (*UserConfig) ToGeneratorConfig ¶
func (c *UserConfig) ToGeneratorConfig() (Config, error)
type Value ¶
type Value struct { Datacenter string `json:",omitempty"` Token string `json:",omitempty"` Value string Namespace string `json:",omitempty"` Flags uint `json:",omitempty"` }
Value is the value type of the KV mapping
type ValueType ¶
type ValueType string
const ( ValueTypeRandomB64 ValueType = "random-b64" DefaultValueType = ValueTypeRandomB64 )
Click to show internal directories.
Click to hide internal directories.