Documentation ¶
Index ¶
- type MockRepository
- 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 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 (r *MockRepository) Add(create service.ShardMapping, run database.RunInTx) error
func (*MockRepository) List ¶ added in v0.11.0
func (r *MockRepository) 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 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 (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.