Documentation ¶
Index ¶
- Variables
- func CheckChildrenForGroupIDs(ctx context.Context, db gorp.SqlExecutor, a *sdk.Action, groupIDs []int64) error
- func CheckChildrenForGroupIDsWithLoop(ctx context.Context, db gorp.SqlExecutor, a *sdk.Action, groupIDs []int64) error
- func ComputeAudit(ctx context.Context, DBFunc func() *gorp.DbMap, chanEvent chan sdk.Event)
- func CreateAsCodeAction(ctx context.Context, db gorpmapper.SqlExecutorWithTx) error
- func CreateBuiltinActions(db gorpmapper.SqlExecutorWithTx) error
- func Delete(db gorp.SqlExecutor, a *sdk.Action) error
- func DeleteAllTypeJoinedByIDs(db gorp.SqlExecutor, ids []int64) error
- func DeleteRequirementsByActionID(db gorp.SqlExecutor, actionID int64) error
- func DeleteTypeJoinedByID(db gorp.SqlExecutor, id int64) error
- func Export(a sdk.Action, f exportentities.Format, w io.Writer) error
- func GetActionUsages(db gorp.SqlExecutor, sharedInfraGroupID, actionID int64) ([]sdk.UsageAction, error)
- func GetAuditByActionIDAndID(ctx context.Context, db gorp.SqlExecutor, actionID, auditID int64) (*sdk.AuditAction, error)
- func GetAuditLatestByActionID(ctx context.Context, db gorp.SqlExecutor, actionID int64) (*sdk.AuditAction, error)
- func GetAuditOldestByActionID(ctx context.Context, db gorp.SqlExecutor, actionID int64) (*sdk.AuditAction, error)
- func GetAuditsByActionID(db gorp.SqlExecutor, actionID int64) ([]sdk.AuditAction, error)
- func GetPipelineUsages(db gorp.SqlExecutor, sharedInfraGroupID, actionID int64) ([]sdk.UsagePipeline, error)
- func GetRequirementsDistinctBinary(db gorp.SqlExecutor) (sdk.RequirementList, error)
- func GetRequirementsTypeModelAndValueStartBy(ctx context.Context, db gorp.SqlExecutor, value string) ([]sdk.Requirement, error)
- func Insert(db gorp.SqlExecutor, a *sdk.Action) error
- func InsertAudit(db gorp.SqlExecutor, aa *sdk.AuditAction) error
- func InsertRequirement(db gorp.SqlExecutor, r *sdk.Requirement) error
- func LoadAllByIDs(ctx context.Context, db gorp.SqlExecutor, ids []int64, opts ...LoadOptionFunc) ([]sdk.Action, error)
- func LoadAllByIDsWithTypeBuiltinOrPluginOrDefaultInGroupIDs(ctx context.Context, db gorp.SqlExecutor, ids, groupIDs []int64, ...) ([]sdk.Action, error)
- func LoadAllByTypes(ctx context.Context, db gorp.SqlExecutor, types []string, ...) ([]sdk.Action, error)
- func LoadAllTypeBuiltInOrPluginOrDefaultForGroupIDs(ctx context.Context, db gorp.SqlExecutor, groupIDs []int64, ...) ([]sdk.Action, error)
- func LoadAllTypeDefaultByGroupIDs(ctx context.Context, db gorp.SqlExecutor, groupIDs []int64, ...) ([]sdk.Action, error)
- func LoadByID(ctx context.Context, db gorp.SqlExecutor, id int64, opts ...LoadOptionFunc) (*sdk.Action, error)
- func LoadByTypesAndName(ctx context.Context, db gorp.SqlExecutor, types []string, name string, ...) (*sdk.Action, error)
- func LoadTypeDefaultByNameAndGroupID(ctx context.Context, db gorp.SqlExecutor, name string, groupID int64, ...) (*sdk.Action, error)
- func RetrieveForGroupAndName(ctx context.Context, db gorp.SqlExecutor, g *sdk.Group, name string) (*sdk.Action, error)
- func Update(db gorp.SqlExecutor, a *sdk.Action) error
- func UpdateRequirement(db gorp.SqlExecutor, r *sdk.Requirement) error
- func Used(db gorp.SqlExecutor, actionID int64) (bool, error)
- type LoadOptionFunc
Constants ¶
This section is empty.
Variables ¶
var LoadOptions = struct { Default LoadOptionFunc WithRequirements LoadOptionFunc WithParameters LoadOptionFunc WithChildren LoadOptionFunc WithAudits LoadOptionFunc WithGroup LoadOptionFunc }{ Default: loadDefault, WithRequirements: loadRequirements, WithParameters: loadParameters, WithChildren: loadChildren, WithAudits: loadAudits, WithGroup: loadGroup, }
LoadOptions provides all options on action loads functions.
Functions ¶
func CheckChildrenForGroupIDs ¶
func CheckChildrenForGroupIDs(ctx context.Context, db gorp.SqlExecutor, a *sdk.Action, groupIDs []int64) error
CheckChildrenForGroupIDs returns an error if given children not found.
func CheckChildrenForGroupIDsWithLoop ¶
func CheckChildrenForGroupIDsWithLoop(ctx context.Context, db gorp.SqlExecutor, a *sdk.Action, groupIDs []int64) error
CheckChildrenForGroupIDsWithLoop return an error if given children not found or tree loop detected.
func ComputeAudit ¶
ComputeAudit compute audit on action.
func CreateAsCodeAction ¶ added in v0.53.0
func CreateAsCodeAction(ctx context.Context, db gorpmapper.SqlExecutorWithTx) error
func CreateBuiltinActions ¶
func CreateBuiltinActions(db gorpmapper.SqlExecutorWithTx) error
CreateBuiltinActions add builtin actions in database if needed
func DeleteAllTypeJoinedByIDs ¶
func DeleteAllTypeJoinedByIDs(db gorp.SqlExecutor, ids []int64) error
DeleteAllTypeJoinedByIDs deletes all joined action by ids.
func DeleteRequirementsByActionID ¶
func DeleteRequirementsByActionID(db gorp.SqlExecutor, actionID int64) error
DeleteRequirementsByActionID deletes all requirements related to given action.
func DeleteTypeJoinedByID ¶
func DeleteTypeJoinedByID(db gorp.SqlExecutor, id int64) error
DeleteTypeJoinedByID deletes joined action for id.
func GetActionUsages ¶
func GetActionUsages(db gorp.SqlExecutor, sharedInfraGroupID, actionID int64) ([]sdk.UsageAction, error)
GetActionUsages returns the list of actions using an action
func GetAuditByActionIDAndID ¶
func GetAuditByActionIDAndID(ctx context.Context, db gorp.SqlExecutor, actionID, auditID int64) (*sdk.AuditAction, error)
GetAuditByActionIDAndID returns audit for given action id and audit id.
func GetAuditLatestByActionID ¶
func GetAuditLatestByActionID(ctx context.Context, db gorp.SqlExecutor, actionID int64) (*sdk.AuditAction, error)
GetAuditLatestByActionID returns action latest audit by action id.
func GetAuditOldestByActionID ¶
func GetAuditOldestByActionID(ctx context.Context, db gorp.SqlExecutor, actionID int64) (*sdk.AuditAction, error)
GetAuditOldestByActionID returns action oldtest audit by action id.
func GetAuditsByActionID ¶
func GetAuditsByActionID(db gorp.SqlExecutor, actionID int64) ([]sdk.AuditAction, error)
GetAuditsByActionID returns all action audits by action ids.
func GetPipelineUsages ¶
func GetPipelineUsages(db gorp.SqlExecutor, sharedInfraGroupID, actionID int64) ([]sdk.UsagePipeline, error)
GetPipelineUsages returns the list of pipelines using an action
func GetRequirementsDistinctBinary ¶
func GetRequirementsDistinctBinary(db gorp.SqlExecutor) (sdk.RequirementList, error)
GetRequirementsDistinctBinary retrieves all binary requirements in database. Used by worker to automatically declare most capabilities, this func returns denormalized values.
func GetRequirementsTypeModelAndValueStartBy ¶
func GetRequirementsTypeModelAndValueStartBy(ctx context.Context, db gorp.SqlExecutor, value string) ([]sdk.Requirement, error)
GetRequirementsTypeModelAndValueStartBy returns action requirements from database for given criteria.
func Insert ¶
func Insert(db gorp.SqlExecutor, a *sdk.Action) error
Insert given action and its components in database.
func InsertAudit ¶
func InsertAudit(db gorp.SqlExecutor, aa *sdk.AuditAction) error
InsertAudit in database.
func InsertRequirement ¶
func InsertRequirement(db gorp.SqlExecutor, r *sdk.Requirement) error
InsertRequirement in database.
func LoadAllByIDs ¶
func LoadAllByIDs(ctx context.Context, db gorp.SqlExecutor, ids []int64, opts ...LoadOptionFunc) ([]sdk.Action, error)
LoadAllByIDs retrieves in database action with given ids.
func LoadAllByIDsWithTypeBuiltinOrPluginOrDefaultInGroupIDs ¶
func LoadAllByIDsWithTypeBuiltinOrPluginOrDefaultInGroupIDs(ctx context.Context, db gorp.SqlExecutor, ids, groupIDs []int64, opts ...LoadOptionFunc) ([]sdk.Action, error)
LoadAllByIDsWithTypeBuiltinOrPluginOrDefaultInGroupIDs returns all actions for given ids. Action should be of type builtin, plugin or default. Default action should be in given group ids list.
func LoadAllByTypes ¶
func LoadAllByTypes(ctx context.Context, db gorp.SqlExecutor, types []string, opts ...LoadOptionFunc) ([]sdk.Action, error)
LoadAllByTypes actions from database.
func LoadAllTypeBuiltInOrPluginOrDefaultForGroupIDs ¶
func LoadAllTypeBuiltInOrPluginOrDefaultForGroupIDs(ctx context.Context, db gorp.SqlExecutor, groupIDs []int64, opts ...LoadOptionFunc) ([]sdk.Action, error)
LoadAllTypeBuiltInOrPluginOrDefaultForGroupIDs actions from database.
func LoadAllTypeDefaultByGroupIDs ¶
func LoadAllTypeDefaultByGroupIDs(ctx context.Context, db gorp.SqlExecutor, groupIDs []int64, opts ...LoadOptionFunc) ([]sdk.Action, error)
LoadAllTypeDefaultByGroupIDs actions from database.
func LoadByID ¶
func LoadByID(ctx context.Context, db gorp.SqlExecutor, id int64, opts ...LoadOptionFunc) (*sdk.Action, error)
LoadByID retrieves in database the action with given id.
func LoadByTypesAndName ¶
func LoadByTypesAndName(ctx context.Context, db gorp.SqlExecutor, types []string, name string, opts ...LoadOptionFunc) (*sdk.Action, error)
LoadByTypesAndName returns an action from database with given name and type in list.
func LoadTypeDefaultByNameAndGroupID ¶
func LoadTypeDefaultByNameAndGroupID(ctx context.Context, db gorp.SqlExecutor, name string, groupID int64, opts ...LoadOptionFunc) (*sdk.Action, error)
LoadTypeDefaultByNameAndGroupID returns an action from database with given name and group id.
func RetrieveForGroupAndName ¶
func RetrieveForGroupAndName(ctx context.Context, db gorp.SqlExecutor, g *sdk.Group, name string) (*sdk.Action, error)
RetrieveForGroupAndName try to find an action for given group and name.
func Update ¶
func Update(db gorp.SqlExecutor, a *sdk.Action) error
Update given action and its components in database.
func UpdateRequirement ¶
func UpdateRequirement(db gorp.SqlExecutor, r *sdk.Requirement) error
UpdateRequirement in database.
Types ¶
type LoadOptionFunc ¶
LoadOptionFunc for action.