Documentation ¶
Index ¶
Constants ¶
View Source
const ( // CLATemplatesTable is the name of events table in database CLATemplatesTable = "cla.cla_templates" // NoResultErrorString in error return by sql when it does not get any result NoResultErrorString = "sql: no rows in result set" )
Variables ¶
View Source
var ( // ErrClaTemplateNotFound is error returned when requested cla template does not exist in system ErrClaTemplateNotFound = errors.New("cla template does not exist") )
Functions ¶
func Configure ¶
func Configure(api *operations.ClaAPI, service Service)
Configure setups handlers on api with service
Types ¶
type Repository ¶
type Repository interface { CreateCLATemplate(template *models.ClaTemplateInput) (*models.ClaTemplate, error) GetCLATemplate(claTemplateID string) (*models.ClaTemplate, error) UpdateCLATemplate(claTemplateID string, template *models.ClaTemplateInput) (*models.ClaTemplate, error) DeleteCLATemplate(claTemplateID string) error ListCLATemplates() (*models.ClaTemplateList, error) }
Repository interface defines methods of cla_templates repository service
func NewRepository ¶
func NewRepository(dbConn *sqlx.DB) Repository
NewRepository creates new instance of audit event repository
type SQLCLATemplate ¶
type SQLCLATemplate struct { ID sql.NullString `db:"id"` CreatedAt sql.NullInt64 `db:"created_at"` UpdatedAt sql.NullInt64 `db:"updated_at"` Name sql.NullString `db:"name"` Description sql.NullString `db:"description"` Version sql.NullInt64 `db:"version"` IclaHTMLBody sql.NullString `db:"icla_html_body"` CclaHTMLBody sql.NullString `db:"ccla_html_body"` MetaFields sql.NullString `db:"meta_fields"` IclaFields sql.NullString `db:"icla_fields"` CclaFields sql.NullString `db:"ccla_fields"` }
SQLCLATemplate struct represent row of sql.events table
type Service ¶
type Service interface { CreateCLATemplate(in *params.CreateCLATemplateParams) (*models.ClaTemplate, error) UpdateCLATemplate(in *params.UpdateCLATemplateParams) (*models.ClaTemplate, error) DeleteCLATemplate(in *params.DeleteCLATemplateParams) error GetCLATemplate(in *params.GetCLATemplateParams) (*models.ClaTemplate, error) ListCLATemplate(in *params.ListCLATemplatesParams) (*models.ClaTemplateList, error) }
Service interface defines methods of cla_template service
func NewService ¶
func NewService(repo Repository) Service
NewService creates new instance of cla_template service
Click to show internal directories.
Click to hide internal directories.