shards

package
v0.25.1 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InMemoryRepository added in v0.17.0

type InMemoryRepository struct {
	Shards []service.ShardMapping
}

func NewInMemoryRepository added in v0.17.0

func NewInMemoryRepository(shards ...service.ShardMapping) *InMemoryRepository

func (*InMemoryRepository) Add added in v0.17.0

func (*InMemoryRepository) List added in v0.17.0

func (*InMemoryRepository) Lookup added in v0.17.0

func (r *InMemoryRepository) Lookup(shardKey string) (string, error)

type Repository

type Repository interface {
	Lookup(shardKey string) (string, error)
	List() ([]service.ShardMapping, error)
	Add(create service.ShardMapping, run database.RunInTx) error
}

func NewRepository

func NewRepository(db *sql.DB, static []service.ShardMapping) Repository

type ShardMappingController added in v0.11.0

type ShardMappingController struct {
	// contains filtered or unexported fields
}

func NewShardMappingController added in v0.11.0

func NewShardMappingController(logger log.Logger, service ShardMappingService) *ShardMappingController

func (*ShardMappingController) AppendRoutes added in v0.11.0

func (c *ShardMappingController) AppendRoutes(router *mux.Router) *mux.Router

func (*ShardMappingController) Create added in v0.11.0

func (*ShardMappingController) Get added in v0.11.0

func (*ShardMappingController) List added in v0.11.0

type ShardMappingService added in v0.11.0

type ShardMappingService interface {
	Create(create *service.ShardMapping) (*service.ShardMapping, error)
	List() ([]service.ShardMapping, error)
	Lookup(shardKey string) (string, error)
}

func NewShardMappingService added in v0.11.0

func NewShardMappingService(time stime.TimeService, logger log.Logger, repository Repository) (ShardMappingService, error)

Jump to

Keyboard shortcuts

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