Documentation ¶
Index ¶
- func NewService(db *gorm.DB) domain.TemplatesService
- type Repository
- func (r Repository) Delete(name string) error
- func (r Repository) GetByName(name string) (*Template, error)
- func (r Repository) Index(tag string) ([]Template, error)
- func (r Repository) Migrate() error
- func (r Repository) Render(name string, requestVariables map[string]string) (string, error)
- func (r Repository) Upsert(template *Template) (*Template, error)
- type Service
- func (service Service) Delete(name string) error
- func (service Service) GetByName(name string) (*domain.Template, error)
- func (service Service) Index(tag string) ([]domain.Template, error)
- func (service Service) Migrate() error
- func (service Service) Render(name string, body map[string]string) (string, error)
- func (service Service) Upsert(template *domain.Template) (*domain.Template, error)
- type Template
- type TemplatesRepository
- type TemplatesRepositoryMock
- func (_m *TemplatesRepositoryMock) Delete(_a0 string) error
- func (_m *TemplatesRepositoryMock) GetByName(_a0 string) (*Template, error)
- func (_m *TemplatesRepositoryMock) Index(_a0 string) ([]Template, error)
- func (_m *TemplatesRepositoryMock) Migrate() error
- func (_m *TemplatesRepositoryMock) Render(_a0 string, _a1 map[string]string) (string, error)
- func (_m *TemplatesRepositoryMock) Upsert(_a0 *Template) (*Template, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewService ¶
func NewService(db *gorm.DB) domain.TemplatesService
NewService returns repository struct
Types ¶
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
Repository talks to the store to read or insert data
func NewRepository ¶
func NewRepository(db *gorm.DB) *Repository
NewRepository returns repository struct
func (Repository) Delete ¶
func (r Repository) Delete(name string) error
func (Repository) Migrate ¶
func (r Repository) Migrate() error
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service handles business logic
type TemplatesRepository ¶
type TemplatesRepository interface { Upsert(*Template) (*Template, error) Index(string) ([]Template, error) GetByName(string) (*Template, error) Delete(string) error Render(string, map[string]string) (string, error) Migrate() error }
TemplatesRepositoryMock interface
type TemplatesRepositoryMock ¶
TemplatesRepositoryMock is an autogenerated mock type for the TemplatesRepositoryMock type
func (*TemplatesRepositoryMock) Delete ¶
func (_m *TemplatesRepositoryMock) Delete(_a0 string) error
Delete provides a mock function with given fields: _a0
func (*TemplatesRepositoryMock) GetByName ¶
func (_m *TemplatesRepositoryMock) GetByName(_a0 string) (*Template, error)
GetByName provides a mock function with given fields: _a0
func (*TemplatesRepositoryMock) Index ¶
func (_m *TemplatesRepositoryMock) Index(_a0 string) ([]Template, error)
Index provides a mock function with given fields: _a0
func (*TemplatesRepositoryMock) Migrate ¶
func (_m *TemplatesRepositoryMock) Migrate() error
Migrate provides a mock function with given fields:
Click to show internal directories.
Click to hide internal directories.