mysql

package
v1.16.2 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MySQL

type MySQL struct {
	Conn *sqlx.DB
	// contains filtered or unexported fields
}

MySQL is implement datastore in MySQL

func New

func New(dsn string, notifyEnqueueCh chan<- struct{}) (*MySQL, error)

New create mysql connection

func (*MySQL) CreateRunner

func (m *MySQL) CreateRunner(ctx context.Context, runner datastore.Runner) error

CreateRunner add a runner

func (*MySQL) CreateTarget

func (m *MySQL) CreateTarget(ctx context.Context, target datastore.Target) error

CreateTarget create a target

func (*MySQL) DeleteJob

func (m *MySQL) DeleteJob(ctx context.Context, id uuid.UUID) error

DeleteJob delete a job

func (*MySQL) DeleteRunner

func (m *MySQL) DeleteRunner(ctx context.Context, id uuid.UUID, deletedAt time.Time, reason datastore.RunnerStatus) error

DeleteRunner delete a runner

func (*MySQL) DeleteTarget

func (m *MySQL) DeleteTarget(ctx context.Context, id uuid.UUID) error

DeleteTarget delete a target

func (*MySQL) EnqueueJob

func (m *MySQL) EnqueueJob(ctx context.Context, job datastore.Job) error

EnqueueJob add a job

func (*MySQL) GetLock added in v1.8.1

func (m *MySQL) GetLock(ctx context.Context) error

GetLock get lock

func (*MySQL) GetRunner

func (m *MySQL) GetRunner(ctx context.Context, id uuid.UUID) (*datastore.Runner, error)

GetRunner get a runner

func (*MySQL) GetTarget

func (m *MySQL) GetTarget(ctx context.Context, id uuid.UUID) (*datastore.Target, error)

GetTarget get a target

func (*MySQL) GetTargetByScope

func (m *MySQL) GetTargetByScope(ctx context.Context, scope string) (*datastore.Target, error)

GetTargetByScope get a target from scope

func (*MySQL) IsLocked added in v1.8.1

func (m *MySQL) IsLocked(ctx context.Context) (string, error)

IsLocked return status of lock

func (*MySQL) ListJobs

func (m *MySQL) ListJobs(ctx context.Context) ([]datastore.Job, error)

ListJobs get all jobs

func (*MySQL) ListRunners

func (m *MySQL) ListRunners(ctx context.Context) ([]datastore.Runner, error)

ListRunners get a not deleted runners

func (*MySQL) ListRunnersByTargetID added in v1.10.1

func (m *MySQL) ListRunnersByTargetID(ctx context.Context, targetID uuid.UUID) ([]datastore.Runner, error)

ListRunnersByTargetID get a not deleted runners that has target_id

func (*MySQL) ListTargets

func (m *MySQL) ListTargets(ctx context.Context) ([]datastore.Target, error)

ListTargets get a all target

func (*MySQL) UpdateTargetParam added in v1.10.0

func (m *MySQL) UpdateTargetParam(ctx context.Context, targetID uuid.UUID, newResourceType datastore.ResourceType, newProviderURL sql.NullString) error

UpdateTargetParam update parameter of target

func (*MySQL) UpdateTargetStatus added in v1.3.0

func (m *MySQL) UpdateTargetStatus(ctx context.Context, targetID uuid.UUID, newStatus datastore.TargetStatus, description string) error

UpdateTargetStatus update status in target

func (*MySQL) UpdateToken added in v1.7.0

func (m *MySQL) UpdateToken(ctx context.Context, targetID uuid.UUID, newToken string, newExpiredAt time.Time) error

UpdateToken update token in target

Jump to

Keyboard shortcuts

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