Documentation
¶
Index ¶
Constants ¶
View Source
const ( CLAGroupCreated = "cla_group_created" CLAGroupUpdated = "cla_group_updated" CLAGroupDeleted = "cla_group_deleted" )
Events
View Source
const ( // CLAGroupsTable is the name of cla_groups table in database CLAGroupsTable = "cla.cla_groups" // CLAGroupProjectManagerTable is the name of cla_group_project_managers table in database CLAGroupProjectManagerTable = "cla.cla_group_project_managers" // CLARepositoryTable is name of repositories table in database CLARepositoryTable = "cla.repositories" )
View Source
const ( // DuplicateCLAGroupNameError is an error string // returned by postgres when unique contraint of cla_group_name fails DuplicateCLAGroupNameError = `pq: duplicate key value violates unique constraint "cla_groups_project_id_cla_group_name_key"` )
Variables ¶
View Source
var ( // ErrClaGroupNameAlreadyExist is the error which happens when we create CLA Group with // name which already exist in system ErrClaGroupNameAlreadyExist = errors.New("given cla group name already exist") // ErrClaGroupNotFound is the error that CLA Group does not exist in system ErrClaGroupNotFound = errors.New("cla group does not exist") )
Functions ¶
func Configure ¶
func Configure(api *operations.ClaAPI, service Service)
Configure setups handlers on api with service
Types ¶
type CLAGroupCreatedEvent ¶
type CLAGroupCreatedEvent struct { ClaGroupID string `json:"cla_group_id,omitempty"` ClaGroupName string `json:"cla_group_name,omitempty"` CclaEnabled bool `json:"ccla_enabled,omitempty"` IclaEnabled bool `json:"icla_enabled,omitempty"` ProjectID string `json:"project_id,omitempty"` }
CLAGroupCreatedEvent is data for cla_group_created event
type CLAGroupDeletedEvent ¶
type CLAGroupDeletedEvent struct {
ClaGroupID string `json:"cla_group_id,omitempty"`
}
CLAGroupDeletedEvent is data for cla_group_deleted event
type CLAGroupUpdatedEvent ¶
type CLAGroupUpdatedEvent struct { ClaGroupID string `json:"cla_group_id,omitempty"` ClaGroupName string `json:"cla_group_name,omitempty"` CclaEnabled bool `json:"ccla_enabled,omitempty"` IclaEnabled bool `json:"icla_enabled,omitempty"` }
CLAGroupUpdatedEvent is data for cla_group_updated event
type Repository ¶
type Repository interface { CreateCLAGroup(in *models.CreateClaGroup) (*models.ClaGroup, error) DeleteCLAGroup(claGroupID string) error UpdateCLAGroup(claGroupID string, in *models.UpdateClaGroup) error ListCLAGroups(params *cla_groups.ListCLAGroupsParams) (*models.ClaGroupList, error) }
Repository interface defines methods of cla_groups repository service
func NewRepository ¶
func NewRepository(dbConn *sqlx.DB) Repository
NewRepository creates new instance of cla_groups repository
type SQLCLAGroupProjectManagers ¶
type SQLCLAGroupProjectManagers struct { CLAGroupID sql.NullString `db:"cla_group_id"` ProjectManagerID sql.NullString `db:"project_manager_id"` }
SQLCLAGroupProjectManagers represents row of cla.cla_group_project_managers table
type SQLCLAGroups ¶
type SQLCLAGroups struct { ID sql.NullString `db:"id"` CLAGroupName sql.NullString `db:"cla_group_name"` ProjectID sql.NullString `db:"project_id"` CreatedAt sql.NullInt64 `db:"created_at"` UpdatedAt sql.NullInt64 `db:"updated_at"` CCLAEnabled sql.NullBool `db:"ccla_enabled"` ICLAEnabled sql.NullBool `db:"icla_enabled"` }
SQLCLAGroups represent row of cla.cla_groups table
type Service ¶
type Service interface { CreateCLAGroup(in *cla_groups.CreateCLAGroupParams) (*models.ClaGroup, error) DeleteCLAGroup(in *cla_groups.DeleteCLAGroupParams) error UpdateCLAGroup(in *cla_groups.UpdateCLAGroupParams) error ListCLAGroups(in *cla_groups.ListCLAGroupsParams) (*models.ClaGroupList, error) }
Service interface defines methods of cla_groups service
func NewService ¶
func NewService(repo Repository, eventService events.Service) Service
NewService creates new instance of event service
Click to show internal directories.
Click to hide internal directories.