b1f8ac453b
feat!: base template * first bit of templating * codeowners * linuxbased * restart * baseline project * add grpc api and basic integration test * startqueue * queueMsg * splitscripts * migrations * queueintegrationtest * gateway
25 lines
435 B
Go
25 lines
435 B
Go
package name
|
|
|
|
import (
|
|
"context"
|
|
"gotemplate/internal/database/repository"
|
|
)
|
|
|
|
type Service struct {
|
|
db *repository.Queries
|
|
}
|
|
|
|
func New(ctx context.Context, db *repository.Queries) *Service {
|
|
return &Service{
|
|
db: db,
|
|
}
|
|
}
|
|
|
|
func (s *Service) Add(ctx context.Context, name string) error {
|
|
return s.db.AddName(ctx, name)
|
|
}
|
|
|
|
func (s *Service) Get(ctx context.Context, name string) (string, error) {
|
|
return s.db.GetName(ctx, name)
|
|
}
|