Documentation ¶
Index ¶
- type InMemoryRepository
- type Repository
- type ShardMappingController
- func (c *ShardMappingController) AppendRoutes(router *mux.Router) *mux.Router
- func (c *ShardMappingController) Create(w http.ResponseWriter, r *http.Request)
- func (c *ShardMappingController) Get(w http.ResponseWriter, r *http.Request)
- func (c *ShardMappingController) List(w http.ResponseWriter, r *http.Request)
- type ShardMappingService
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 (r *InMemoryRepository) Add(create service.ShardMapping, _ database.RunInTx) error
func (*InMemoryRepository) List ¶ added in v0.17.0
func (r *InMemoryRepository) List() ([]service.ShardMapping, 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 (c *ShardMappingController) Create(w http.ResponseWriter, r *http.Request)
func (*ShardMappingController) Get ¶ added in v0.11.0
func (c *ShardMappingController) Get(w http.ResponseWriter, r *http.Request)
func (*ShardMappingController) List ¶ added in v0.11.0
func (c *ShardMappingController) List(w http.ResponseWriter, r *http.Request)
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)
Click to show internal directories.
Click to hide internal directories.