Documentation ¶
Index ¶
- type Config
- type Handler
- func (h *Handler) AllDatabases() func(w http.ResponseWriter, r *http.Request)
- func (h *Handler) CreateItemHandler() func(w http.ResponseWriter, r *http.Request)
- func (h *Handler) GetItemHandler() func(w http.ResponseWriter, r *http.Request)
- func (h *Handler) LivenessHandler() func(w http.ResponseWriter, r *http.Request)
- func (h *Handler) UpdateItemHandler() func(w http.ResponseWriter, r *http.Request)
- type Items
- func (i *Items) AddOne(ctx context.Context, m *model.SampleItem) error
- func (i *Items) AllDatabases(ctx context.Context) ([]string, error)
- func (i *Items) GetOne(ctx context.Context, id int) (*model.SampleItem, error)
- func (i *Items) List(_ context.Context) ([]*model.SampleItem, error)
- func (i *Items) Readiness() error
- func (i *Items) UpdateOne(ctx context.Context, m *model.SampleItem) error
- type ItemsSampleUsage
- type Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { AMQP rabbitmq.Config Cache redis.Config Database database.Database HTTP api.Config }
Config for application
func (*Config) AMQPConfig ¶
AMQPConfig implements setup.AMQPConfigProvider
func (*Config) CacheConfig ¶
CacheConfig implements setup.CacheConfigProvider
func (*Config) DatabaseConfig ¶
DatabaseConfig implements setup.DatabaseConfigProvider
func (*Config) HTTPConfig ¶
HTTPConfig implements setup.HTTPConfigProvider
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler ...
func (*Handler) AllDatabases ¶
func (h *Handler) AllDatabases() func(w http.ResponseWriter, r *http.Request)
AllDatabases sample handler to get with all db names
func (*Handler) CreateItemHandler ¶
func (h *Handler) CreateItemHandler() func(w http.ResponseWriter, r *http.Request)
CreateItemHandler creates new model.SampleItem
func (*Handler) GetItemHandler ¶
func (h *Handler) GetItemHandler() func(w http.ResponseWriter, r *http.Request)
GetItemHandler render an item by id
func (*Handler) LivenessHandler ¶
func (h *Handler) LivenessHandler() func(w http.ResponseWriter, r *http.Request)
LivenessHandler to check api response
func (*Handler) UpdateItemHandler ¶
func (h *Handler) UpdateItemHandler() func(w http.ResponseWriter, r *http.Request)
UpdateItemHandler updates model.SampleItem
type Items ¶
type Items struct {
// contains filtered or unexported fields
}
Items implements ItemsSampleUsage
func NewItemsDomain ¶
func NewItemsDomain(repo *datasource.SampleDB, pbl rabbitmq.AMQPPublisher) *Items
NewItemsDomain constructor
func (*Items) AllDatabases ¶
AllDatabases sample method to get with all db names
type ItemsSampleUsage ¶
type ItemsSampleUsage interface { Readiness() error AllDatabases(ctx context.Context) ([]string, error) AddOne(ctx context.Context, m *model.SampleItem) error UpdateOne(ctx context.Context, m *model.SampleItem) error GetOne(ctx context.Context, id int) (*model.SampleItem, error) List(ctx context.Context) ([]*model.SampleItem, error) }
ItemsSampleUsage represents sample usage of sample domain
Click to show internal directories.
Click to hide internal directories.