Documentation ¶
Index ¶
- Variables
- func AddServiceToGroupQuery(appGroupID string, serviceID string, tx *sql.Tx) error
- type AppGroupMongoRepository
- func (agmr *AppGroupMongoRepository) AddServiceToGroup(appGroupID string, serviceID string) error
- func (agmr *AppGroupMongoRepository) CommitTransaction()
- func (agmr *AppGroupMongoRepository) CreateApplicationGroup(bodyMap ApplicationGroup) error
- func (agmr *AppGroupMongoRepository) DeleteApplicationGroup(appGroupID string) error
- func (agmr *AppGroupMongoRepository) FindServiceApplicationGroup(serviceID string) ApplicationGroup
- func (agmr *AppGroupMongoRepository) GetApplicationGroupByID(appGroupID string) (ApplicationGroup, error)
- func (agmr *AppGroupMongoRepository) GetApplicationGroups(page int, nameFilter string) []ApplicationGroup
- func (agmr *AppGroupMongoRepository) GetServicesForApplicationGroup(appGroup ApplicationGroup) ([]service.Service, error)
- func (agmr *AppGroupMongoRepository) OpenTransaction() error
- func (agmr *AppGroupMongoRepository) Release()
- func (agmr *AppGroupMongoRepository) RemoveServiceFromGroup(appGroupID string, serviceID string) error
- func (agmr *AppGroupMongoRepository) RollbackTransaction()
- func (agmr *AppGroupMongoRepository) UngroupedServices() []service.Service
- func (agmr *AppGroupMongoRepository) UpdateApplicationGroup(appGroupID string, newGroup ApplicationGroup) error
- type AppGroupOracleRepository
- func (agmr *AppGroupOracleRepository) AddServiceToGroup(appGroupID string, serviceID string) error
- func (agmr *AppGroupOracleRepository) CommitTransaction()
- func (agmr *AppGroupOracleRepository) CreateApplicationGroup(bodyMap ApplicationGroup) error
- func (agmr *AppGroupOracleRepository) DeleteApplicationGroup(appGroupID string) error
- func (agmr *AppGroupOracleRepository) FindServiceApplicationGroup(serviceID string) ApplicationGroup
- func (agmr *AppGroupOracleRepository) GetApplicationGroupByID(appGroupID string) (ApplicationGroup, error)
- func (agmr *AppGroupOracleRepository) GetApplicationGroups(page int, nameFilter string) []ApplicationGroup
- func (agmr *AppGroupOracleRepository) GetServicesForApplicationGroup(appGroup ApplicationGroup) ([]service.Service, error)
- func (agmr *AppGroupOracleRepository) OpenTransaction() error
- func (agmr *AppGroupOracleRepository) Release()
- func (agmr *AppGroupOracleRepository) RemoveServiceFromGroup(appGroupID string, serviceID string) error
- func (agmr *AppGroupOracleRepository) RollbackTransaction()
- func (agmr *AppGroupOracleRepository) UngroupedServices() []service.Service
- func (agmr *AppGroupOracleRepository) UpdateApplicationGroup(appGroupID string, newGroup ApplicationGroup) error
- type AppGroupRepository
- type ApplicationGroup
- type ApplicationGroupService
- func (apgs *ApplicationGroupService) AddServiceToGroup(appGroupID string, serviceID string) error
- func (apgs *ApplicationGroupService) CreateApplicationGroup(bodyMap ApplicationGroup) error
- func (apgs *ApplicationGroupService) DeleteApplicationGroup(appGroupID string) error
- func (apgs *ApplicationGroupService) FindServiceApplicationGroup(serviceID string) ApplicationGroup
- func (apgs *ApplicationGroupService) GetApplicationGroupByID(appGroupID string) (ApplicationGroup, error)
- func (apgs *ApplicationGroupService) GetApplicationGroups(page int, nameFilter string) []ApplicationGroup
- func (apgs *ApplicationGroupService) GetServicesForApplicationGroup(appGroup ApplicationGroup) ([]service.Service, error)
- func (apgs *ApplicationGroupService) RemoveServiceFromGroup(appGroupID string, serviceID string) error
- func (apgs *ApplicationGroupService) UngroupedServices() []service.Service
- func (apgs *ApplicationGroupService) UpdateApplicationGroup(appGroupID string, newGroup ApplicationGroup) error
Constants ¶
This section is empty.
Variables ¶
var ASSOCIATE_APPLICATION_TO_GROUP = `update gapi_services set applicationgroupid = :groupid where id = :id`
var DELETE_APPLICATION_GROUP = `delete from gapi_services_apps_groups where id = :id`
var GET_APPLICATION_GROUP_BY_ID = `select id, name, '' as services from gapi_services_apps_groups where id = :id`
var GET_APPLICATION_GROUP_FOR_SERVICE = `` /* 135-byte string literal not displayed */
var GET_SERVICES_FOR_APPLICATION_GROUP = `select ` + service.SERVICE_COLUMNS + `
from gapi_services a left join gapi_services_groups b on a.groupid = b.id, gapi_services_apps_groups c where a.applicationgroupid = c.id and c.id = :id`
var INSERT_APPLICATION_GROUP = `insert into gapi_services_apps_groups(id, name) values (:id, :name)`
var LIST_APPLICATION_GROUP = `select a.id, a.name from gapi_services_apps_groups a where a.name like :name`
var LIST_APPLICATION_GROUP_V2 = `` /* 215-byte string literal not displayed */
var UNGROUPED_SERVICES = `select ` + service.SERVICE_COLUMNS + ` from gapi_services a left join gapi_services_groups b on a.groupid = b.id where applicationgroupid is null`
var UPDATE_APPLICATION_GROUP = `update gapi_services_apps_groups set name = :name where id = :id`
Functions ¶
Types ¶
type AppGroupMongoRepository ¶
type AppGroupMongoRepository struct { Session *mgo.Session Db *mgo.Database Collection *mgo.Collection }
func (*AppGroupMongoRepository) AddServiceToGroup ¶
func (agmr *AppGroupMongoRepository) AddServiceToGroup(appGroupID string, serviceID string) error
AddServiceToGroup add service with id serviceID to application group with id appGroupID
func (*AppGroupMongoRepository) CommitTransaction ¶
func (agmr *AppGroupMongoRepository) CommitTransaction()
CommitTransaction commit database transaction
func (*AppGroupMongoRepository) CreateApplicationGroup ¶
func (agmr *AppGroupMongoRepository) CreateApplicationGroup(bodyMap ApplicationGroup) error
CreateApplicationGroup create application group
func (*AppGroupMongoRepository) DeleteApplicationGroup ¶
func (agmr *AppGroupMongoRepository) DeleteApplicationGroup(appGroupID string) error
DeleteApplicationGroup delete application group by id
func (*AppGroupMongoRepository) FindServiceApplicationGroup ¶
func (agmr *AppGroupMongoRepository) FindServiceApplicationGroup(serviceID string) ApplicationGroup
FindServiceApplicationGroup get application group for service with id serviceID
func (*AppGroupMongoRepository) GetApplicationGroupByID ¶
func (agmr *AppGroupMongoRepository) GetApplicationGroupByID(appGroupID string) (ApplicationGroup, error)
GetApplicationGroupByID get application group by id
func (*AppGroupMongoRepository) GetApplicationGroups ¶
func (agmr *AppGroupMongoRepository) GetApplicationGroups(page int, nameFilter string) []ApplicationGroup
GetApplicationGroups get list of application groups
func (*AppGroupMongoRepository) GetServicesForApplicationGroup ¶
func (agmr *AppGroupMongoRepository) GetServicesForApplicationGroup(appGroup ApplicationGroup) ([]service.Service, error)
GetServicesForApplicationGroup get application group's services
func (*AppGroupMongoRepository) OpenTransaction ¶
func (agmr *AppGroupMongoRepository) OpenTransaction() error
OpenTransaction open new database transaction
func (*AppGroupMongoRepository) Release ¶
func (agmr *AppGroupMongoRepository) Release()
Release release current database connection
func (*AppGroupMongoRepository) RemoveServiceFromGroup ¶
func (agmr *AppGroupMongoRepository) RemoveServiceFromGroup(appGroupID string, serviceID string) error
RemoveServiceFromGroup remove service from application group
func (*AppGroupMongoRepository) RollbackTransaction ¶
func (agmr *AppGroupMongoRepository) RollbackTransaction()
RollbackTransaction rollback current transaction
func (*AppGroupMongoRepository) UngroupedServices ¶
func (agmr *AppGroupMongoRepository) UngroupedServices() []service.Service
UngroupedServices get list of services without any application group
func (*AppGroupMongoRepository) UpdateApplicationGroup ¶
func (agmr *AppGroupMongoRepository) UpdateApplicationGroup(appGroupID string, newGroup ApplicationGroup) error
UpdateApplicationGroup update application group with id appGroupID
type AppGroupOracleRepository ¶
func (*AppGroupOracleRepository) AddServiceToGroup ¶
func (agmr *AppGroupOracleRepository) AddServiceToGroup(appGroupID string, serviceID string) error
AddServiceToGroup add service with id serviceID to application group with id appGroupID
func (*AppGroupOracleRepository) CommitTransaction ¶
func (agmr *AppGroupOracleRepository) CommitTransaction()
func (*AppGroupOracleRepository) CreateApplicationGroup ¶
func (agmr *AppGroupOracleRepository) CreateApplicationGroup(bodyMap ApplicationGroup) error
CreateApplicationGroup create application group
func (*AppGroupOracleRepository) DeleteApplicationGroup ¶
func (agmr *AppGroupOracleRepository) DeleteApplicationGroup(appGroupID string) error
DeleteApplicationGroup delete application group by id
func (*AppGroupOracleRepository) FindServiceApplicationGroup ¶
func (agmr *AppGroupOracleRepository) FindServiceApplicationGroup(serviceID string) ApplicationGroup
FindServiceApplicationGroup get application group for service with id serviceID
func (*AppGroupOracleRepository) GetApplicationGroupByID ¶
func (agmr *AppGroupOracleRepository) GetApplicationGroupByID(appGroupID string) (ApplicationGroup, error)
GetApplicationGroupByID get application group by id
func (*AppGroupOracleRepository) GetApplicationGroups ¶
func (agmr *AppGroupOracleRepository) GetApplicationGroups(page int, nameFilter string) []ApplicationGroup
GetApplicationGroups get list of application groups
func (*AppGroupOracleRepository) GetServicesForApplicationGroup ¶
func (agmr *AppGroupOracleRepository) GetServicesForApplicationGroup(appGroup ApplicationGroup) ([]service.Service, error)
GetServicesForApplicationGroup get application group's services
func (*AppGroupOracleRepository) OpenTransaction ¶
func (agmr *AppGroupOracleRepository) OpenTransaction() error
func (*AppGroupOracleRepository) Release ¶
func (agmr *AppGroupOracleRepository) Release()
func (*AppGroupOracleRepository) RemoveServiceFromGroup ¶
func (agmr *AppGroupOracleRepository) RemoveServiceFromGroup(appGroupID string, serviceID string) error
RemoveServiceFromGroup remove service from application group
func (*AppGroupOracleRepository) RollbackTransaction ¶
func (agmr *AppGroupOracleRepository) RollbackTransaction()
func (*AppGroupOracleRepository) UngroupedServices ¶
func (agmr *AppGroupOracleRepository) UngroupedServices() []service.Service
UngroupedServices get list of services without any application group
func (*AppGroupOracleRepository) UpdateApplicationGroup ¶
func (agmr *AppGroupOracleRepository) UpdateApplicationGroup(appGroupID string, newGroup ApplicationGroup) error
UpdateApplicationGroup update application group with id appGroupID
type AppGroupRepository ¶
type AppGroupRepository interface { UpdateApplicationGroup(appGroupID string, newGroup ApplicationGroup) error FindServiceApplicationGroup(serviceID string) ApplicationGroup CreateApplicationGroup(bodyMap ApplicationGroup) error GetApplicationGroups(page int, nameFilter string) []ApplicationGroup GetApplicationGroupByID(appGroupID string) (ApplicationGroup, error) GetServicesForApplicationGroup(appGroup ApplicationGroup) ([]service.Service, error) DeleteApplicationGroup(appGroupID string) error AddServiceToGroup(appGroupID string, serviceID string) error RemoveServiceFromGroup(appGroupID string, serviceID string) error UngroupedServices() []service.Service OpenTransaction() error CommitTransaction() RollbackTransaction() Release() }
func NewAppGroupRepository ¶
func NewAppGroupRepository(user userModels.User) AppGroupRepository
NewAppGroupRepository create an application group repository based on the database
type ApplicationGroup ¶
type ApplicationGroup struct { Id bson.ObjectId `bson:"_id" json:"Id"` Name string Services []bson.ObjectId }
func RowsToAppGroup ¶
func RowsToAppGroup(rows *sql.Rows, containsPagination bool) []ApplicationGroup
RowsToAppGroup get applications groups from sql rows
type ApplicationGroupService ¶
type ApplicationGroupService struct { User userModels.User AppGroupRepos AppGroupRepository }
func NewApplicationGroupService ¶
func NewApplicationGroupService(c *routing.Context) (ApplicationGroupService, error)
NewApplicationGroupService create application group service
func NewApplicationGroupServiceWithUser ¶
func NewApplicationGroupServiceWithUser(user userModels.User) (ApplicationGroupService, error)
NewApplicationGroupServiceWithUser create application group service
func (*ApplicationGroupService) AddServiceToGroup ¶
func (apgs *ApplicationGroupService) AddServiceToGroup(appGroupID string, serviceID string) error
AddServiceToGroup add srevice to group
func (*ApplicationGroupService) CreateApplicationGroup ¶
func (apgs *ApplicationGroupService) CreateApplicationGroup(bodyMap ApplicationGroup) error
CreateApplicationGroup create application group
func (*ApplicationGroupService) DeleteApplicationGroup ¶
func (apgs *ApplicationGroupService) DeleteApplicationGroup(appGroupID string) error
DeleteApplicationGroup delete applicaiton group
func (*ApplicationGroupService) FindServiceApplicationGroup ¶
func (apgs *ApplicationGroupService) FindServiceApplicationGroup(serviceID string) ApplicationGroup
FindServiceApplicationGroup find application group for a service
func (*ApplicationGroupService) GetApplicationGroupByID ¶
func (apgs *ApplicationGroupService) GetApplicationGroupByID(appGroupID string) (ApplicationGroup, error)
GetApplicationGroupByID get application group by id
func (*ApplicationGroupService) GetApplicationGroups ¶
func (apgs *ApplicationGroupService) GetApplicationGroups(page int, nameFilter string) []ApplicationGroup
GetApplicationGroups get list of application groups
func (*ApplicationGroupService) GetServicesForApplicationGroup ¶
func (apgs *ApplicationGroupService) GetServicesForApplicationGroup(appGroup ApplicationGroup) ([]service.Service, error)
GetServicesForApplicationGroup get application group's services
func (*ApplicationGroupService) RemoveServiceFromGroup ¶
func (apgs *ApplicationGroupService) RemoveServiceFromGroup(appGroupID string, serviceID string) error
RemoveServiceFromGroup get application group by id
func (*ApplicationGroupService) UngroupedServices ¶
func (apgs *ApplicationGroupService) UngroupedServices() []service.Service
UngroupedServices get application group by id
func (*ApplicationGroupService) UpdateApplicationGroup ¶
func (apgs *ApplicationGroupService) UpdateApplicationGroup(appGroupID string, newGroup ApplicationGroup) error
UpdateApplicationGroup update application group