shards

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2022 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 MockRepository added in v0.2.0

type MockRepository struct {
	Shards map[string]service.ShardMapping
}

func NewMockRepository added in v0.2.0

func NewMockRepository() *MockRepository

func (*MockRepository) Add added in v0.11.0

func (*MockRepository) List added in v0.11.0

func (r *MockRepository) List() ([]service.ShardMapping, error)

func (*MockRepository) Lookup added in v0.2.0

func (r *MockRepository) 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 map[string]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