db

package
v0.0.0-...-6049a1a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 30, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdminRepository

type AdminRepository struct {
	Pool *DatabasePool
}

func (*AdminRepository) GetByID

func (this *AdminRepository) GetByID(id int64) (*sm.AdminUser, error)

func (*AdminRepository) GetByUsername

func (this *AdminRepository) GetByUsername(username string) (*sm.AdminUser, error)

func (*AdminRepository) Insert

func (this *AdminRepository) Insert(user *sm.AdminUser) error

func (*AdminRepository) SavePassword

func (this *AdminRepository) SavePassword(admin *sm.AdminUser) error

type AssetRepository

type AssetRepository struct {
	Pool *DatabasePool
}

func (*AssetRepository) Create

func (this *AssetRepository) Create(asset *sm.Asset) error

func (*AssetRepository) DeleteAssetsForJob

func (this *AssetRepository) DeleteAssetsForJob(job_id int64) error

func (*AssetRepository) GetAsset

func (this *AssetRepository) GetAsset(asset_id int64) (*sm.Asset, error)

func (*AssetRepository) GetAssetByUrlParam

func (this *AssetRepository) GetAssetByUrlParam(url_param string) (*sm.Asset, error)

func (*AssetRepository) GetAssetsForJob

func (this *AssetRepository) GetAssetsForJob(job_id int64, assets *[]*sm.Asset) error

func (*AssetRepository) GetAssetsForUser

func (this *AssetRepository) GetAssetsForUser(content_owner_id int64, assets *[]*sm.Asset) error

type ContentOwnerRepository

type ContentOwnerRepository struct {
	Pool *DatabasePool
}

func (*ContentOwnerRepository) EmailExists

func (this *ContentOwnerRepository) EmailExists(email string) (bool, error)

func (*ContentOwnerRepository) GetAll

func (this *ContentOwnerRepository) GetAll() ([]*sm.ContentOwner, error)

func (*ContentOwnerRepository) GetContentOwnerByID

func (this *ContentOwnerRepository) GetContentOwnerByID(owner *sm.ContentOwner) error

func (*ContentOwnerRepository) GetContentOwnerByUsername

func (this *ContentOwnerRepository) GetContentOwnerByUsername(
	username string) (*sm.ContentOwner, error)

func (*ContentOwnerRepository) Insert

func (this *ContentOwnerRepository) Insert(owner *sm.ContentOwner) error

func (*ContentOwnerRepository) NameExists

func (this *ContentOwnerRepository) NameExists(name string) (bool, error)

func (*ContentOwnerRepository) Save

func (this *ContentOwnerRepository) Save(owner *sm.ContentOwner) error

func (*ContentOwnerRepository) SavePassword

func (this *ContentOwnerRepository) SavePassword(owner *sm.ContentOwner) error

func (*ContentOwnerRepository) UsernameExists

func (this *ContentOwnerRepository) UsernameExists(username string) (bool, error)

type DatabasePool

type DatabasePool struct {
	DB *sql.DB
	// contains filtered or unexported fields
}

func Open

func Open() (*DatabasePool, error)

func (*DatabasePool) Close

func (this *DatabasePool) Close()

func (*DatabasePool) Prepare

func (this *DatabasePool) Prepare(query string) (*sql.Stmt, error)

type JobRepository

type JobRepository struct {
	Pool *DatabasePool
}

func (*JobRepository) CancelJobsWithExceedingExpirationDate

func (this *JobRepository) CancelJobsWithExceedingExpirationDate(
	timestamp time.Time) error

func (*JobRepository) CancelJobsWithExceedingPublicatinDate

func (this *JobRepository) CancelJobsWithExceedingPublicatinDate(
	timestamp time.Time) error

func (*JobRepository) CreateJob

func (this *JobRepository) CreateJob(job *sm.Job) error

func (*JobRepository) DeleteParamsForJob

func (this *JobRepository) DeleteParamsForJob(job_id int64) error

func (*JobRepository) ExpireJobsBefore

func (this *JobRepository) ExpireJobsBefore(timestamp time.Time) error

func (*JobRepository) GetJobByID

func (this *JobRepository) GetJobByID(job_id int64) (*sm.Job, error)

func (*JobRepository) GetJobByStepID

func (this *JobRepository) GetJobByStepID(step_id int64) (*sm.Job, error)

func (*JobRepository) GetJobStepForModule

func (this *JobRepository) GetJobStepForModule(
	step_id, module_id int64) (map[string]interface{}, error)

func (*JobRepository) GetJobSteps

func (this *JobRepository) GetJobSteps(job_id int64, steps *[]*sm.JobStep) error

func (*JobRepository) GetJobsExceedingExpirationDate

func (this *JobRepository) GetJobsExceedingExpirationDate(
	timestamp time.Time,
	limit, offset_id int64) ([]*sm.Job, error)

func (*JobRepository) GetJobsExceedingPublicationDate

func (this *JobRepository) GetJobsExceedingPublicationDate(
	timestamp time.Time,
	limit, offset_id int64) ([]*sm.Job, error)

func (*JobRepository) GetJobsForContentOwner

func (this *JobRepository) GetJobsForContentOwner(
	owner_id, limit, before_job_id int64) ([]*sm.Job, error)

func (*JobRepository) GetJobsStepsForModule

func (this *JobRepository) GetJobsStepsForModule(
	module_id,
	limit,
	before_step_id int64) ([]map[string]interface{}, error)

func (*JobRepository) GetNewExpiredJobsAt

func (this *JobRepository) GetNewExpiredJobsAt(
	timestamp time.Time,
	limit int64,
	offset_id int64) ([]*sm.Job, error)

func (*JobRepository) GetParamsForStep

func (this *JobRepository) GetParamsForStep(step *sm.JobStep) error

func (*JobRepository) SaveFinishedState

func (this *JobRepository) SaveFinishedState(job *sm.Job) error

SaveFinishedState saves the completion_date, status and sets the is_completed to true

func (*JobRepository) SaveStatus

func (this *JobRepository) SaveStatus(job *sm.Job) error

func (*JobRepository) SaveStepProgress

func (this *JobRepository) SaveStepProgress(job *sm.Job) error

SaveStepProgress updates the current_step and also saves the output of the previous task to the database

func (*JobRepository) TaskHasActiveJobs

func (this *JobRepository) TaskHasActiveJobs(task_id int64) (bool, error)

type ModuleRepository

type ModuleRepository struct {
	Pool *DatabasePool
}

func (*ModuleRepository) CreateModule

func (this *ModuleRepository) CreateModule(module *sm.Module) error

func (*ModuleRepository) GenerateApiKey

func (this *ModuleRepository) GenerateApiKey(module_name string) string

func (*ModuleRepository) GetModuleByID

func (this *ModuleRepository) GetModuleByID(id int64) (*sm.Module, error)

func (*ModuleRepository) GetModuleByKey

func (this *ModuleRepository) GetModuleByKey(api_key string) (*sm.Module, error)

func (*ModuleRepository) GetModules

func (this *ModuleRepository) GetModules(modules *[]map[string]interface{}) error

func (*ModuleRepository) GetModulesOBJ

func (this *ModuleRepository) GetModulesOBJ(modules *[]*sm.Module) error

func (*ModuleRepository) IsNameInUse

func (this *ModuleRepository) IsNameInUse(name string) (bool, error)

func (*ModuleRepository) Save

func (this *ModuleRepository) Save(module *sm.Module) error

func (*ModuleRepository) SetAvailability

func (this *ModuleRepository) SetAvailability(id int64, enabled bool) error

type TaskRepository

type TaskRepository struct {
	Pool *DatabasePool
}

func (*TaskRepository) CreateTask

func (this *TaskRepository) CreateTask(task *sm.Task) error

func (*TaskRepository) DeleteTask

func (this *TaskRepository) DeleteTask(id int64) error

func (*TaskRepository) GetTask

func (this *TaskRepository) GetTask(id int64) (*sm.Task, error)

func (*TaskRepository) GetTasks

func (this *TaskRepository) GetTasks(module_id int64, fetch_deleted bool) ([]*sm.Task, error)

func (*TaskRepository) NameExists

func (this *TaskRepository) NameExists(name string) (bool, error)

func (*TaskRepository) Save

func (this *TaskRepository) Save(task *sm.Task) error

func (*TaskRepository) SaveVars

func (this *TaskRepository) SaveVars(task *sm.Task, is_input bool) error

func (*TaskRepository) SetAvailability

func (this *TaskRepository) SetAvailability(id int64, enabled bool) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL