Skip to content

Hasher in client config is unusable #14

Open
@skinass

Description

@skinass
type Config struct {
	Hasher     hasher
        ...
type hasher interface {
	update(servers []*server)
	getServerIndex(key string) (uint, error)
}

now Hasher should implement an interface with private methods with private types like *server so the only way to define a Hasher is to use a NewModuloHasher() function.

the problem is that Hasher field is public, but i cant really use it.

i purpose to change the interface this way:

type Hasher interface {
	Update(servers []strings)
	GetServerIndex(key string) (uint, error)
}

this will let us to make custom implemenation of Hasher interface

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions