config

package
v0.0.0-...-908ee96 Latest Latest
Warning

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

Go to latest
Published: May 30, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Shards []Shard
}

func ParseFile

func ParseFile(filename string) (Config, error)

ParseFile parses the config and return it if success.

type Shard

type Shard struct {
	Name    string
	Idx     int
	Address string
}

Shard each shard has unique set of keys and values.

type Shards

type Shards struct {
	Count  int
	CurIdx int
	Addrs  map[int]string
}

func ParseShards

func ParseShards(shards []Shard, curShardName string) (*Shards, error)

ParseShards converts and verifies a list of shards convert them into a form that can be used for routing.

func (*Shards) Index

func (s *Shards) Index(key string) int

Index returns the hashed index for the corresponding key.

Jump to

Keyboard shortcuts

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