stores

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	JOBS_PATH      = "/agscheduler/jobs"
	RUN_TIMES_PATH = "/agscheduler/run_times"
)
View Source
const (
	DATABASE   = "agscheduler"
	COLLECTION = "jobs"
)
View Source
const (
	JOBS_KEY      = "agscheduler.jobs"
	RUN_TIMES_KEY = "agscheduler.run_times"
)
View Source
const TABLE_NAME = "jobs"

Variables

This section is empty.

Functions

This section is empty.

Types

type EtcdStore

type EtcdStore struct {
	Cli          *clientv3.Client
	JobsPath     string
	RunTimesPath string
}

Stores jobs in a etcd.

func (*EtcdStore) AddJob

func (s *EtcdStore) AddJob(j agscheduler.Job) error

func (*EtcdStore) Clear

func (s *EtcdStore) Clear() error

func (*EtcdStore) DeleteAllJobs

func (s *EtcdStore) DeleteAllJobs() error

func (*EtcdStore) DeleteJob

func (s *EtcdStore) DeleteJob(id string) error

func (*EtcdStore) GetAllJobs

func (s *EtcdStore) GetAllJobs() ([]agscheduler.Job, error)

func (*EtcdStore) GetJob

func (s *EtcdStore) GetJob(id string) (agscheduler.Job, error)

func (*EtcdStore) GetNextRunTime

func (s *EtcdStore) GetNextRunTime() (time.Time, error)

func (*EtcdStore) Init

func (s *EtcdStore) Init() error

func (*EtcdStore) UpdateJob

func (s *EtcdStore) UpdateJob(j agscheduler.Job) error

type GORMStore

type GORMStore struct {
	DB        *gorm.DB
	TableName string
}

Stores jobs in a database table using GORM. The table will be created if it doesn't exist in the database.

func (*GORMStore) AddJob

func (s *GORMStore) AddJob(j agscheduler.Job) error

func (*GORMStore) Clear

func (s *GORMStore) Clear() error

func (*GORMStore) DeleteAllJobs

func (s *GORMStore) DeleteAllJobs() error

func (*GORMStore) DeleteJob

func (s *GORMStore) DeleteJob(id string) error

func (*GORMStore) GetAllJobs

func (s *GORMStore) GetAllJobs() ([]agscheduler.Job, error)

func (*GORMStore) GetJob

func (s *GORMStore) GetJob(id string) (agscheduler.Job, error)

func (*GORMStore) GetNextRunTime

func (s *GORMStore) GetNextRunTime() (time.Time, error)

func (*GORMStore) Init

func (s *GORMStore) Init() error

func (*GORMStore) UpdateJob

func (s *GORMStore) UpdateJob(j agscheduler.Job) error

type Jobs

type Jobs struct {
	ID          string    `gorm:"size:64;primaryKey"`
	NextRunTime time.Time `gorm:"index"`
	State       []byte    `gorm:"type:bytes;not null"`
}

GORM table

type MemoryStore

type MemoryStore struct {
	// contains filtered or unexported fields
}

Stores jobs in an array in RAM. Provides no persistence support.

func (*MemoryStore) AddJob

func (s *MemoryStore) AddJob(j agscheduler.Job) error

func (*MemoryStore) Clear

func (s *MemoryStore) Clear() error

func (*MemoryStore) DeleteAllJobs

func (s *MemoryStore) DeleteAllJobs() error

func (*MemoryStore) DeleteJob

func (s *MemoryStore) DeleteJob(id string) error

func (*MemoryStore) GetAllJobs

func (s *MemoryStore) GetAllJobs() ([]agscheduler.Job, error)

func (*MemoryStore) GetJob

func (s *MemoryStore) GetJob(id string) (agscheduler.Job, error)

func (*MemoryStore) GetNextRunTime

func (s *MemoryStore) GetNextRunTime() (time.Time, error)

func (*MemoryStore) Init

func (s *MemoryStore) Init() error

func (*MemoryStore) UpdateJob

func (s *MemoryStore) UpdateJob(j agscheduler.Job) error

type MongoDBStore

type MongoDBStore struct {
	Client     *mongo.Client
	Database   string
	Collection string
	// contains filtered or unexported fields
}

Stores jobs in a MongoDB database.

func (*MongoDBStore) AddJob

func (s *MongoDBStore) AddJob(j agscheduler.Job) error

func (*MongoDBStore) Clear

func (s *MongoDBStore) Clear() error

func (*MongoDBStore) DeleteAllJobs

func (s *MongoDBStore) DeleteAllJobs() error

func (*MongoDBStore) DeleteJob

func (s *MongoDBStore) DeleteJob(id string) error

func (*MongoDBStore) GetAllJobs

func (s *MongoDBStore) GetAllJobs() ([]agscheduler.Job, error)

func (*MongoDBStore) GetJob

func (s *MongoDBStore) GetJob(id string) (agscheduler.Job, error)

func (*MongoDBStore) GetNextRunTime

func (s *MongoDBStore) GetNextRunTime() (time.Time, error)

func (*MongoDBStore) Init

func (s *MongoDBStore) Init() error

func (*MongoDBStore) UpdateJob

func (s *MongoDBStore) UpdateJob(j agscheduler.Job) error

type RedisStore

type RedisStore struct {
	RDB         *redis.Client
	JobsKey     string
	RunTimesKey string
}

Stores jobs in a Redis database.

func (*RedisStore) AddJob

func (s *RedisStore) AddJob(j agscheduler.Job) error

func (*RedisStore) Clear

func (s *RedisStore) Clear() error

func (*RedisStore) DeleteAllJobs

func (s *RedisStore) DeleteAllJobs() error

func (*RedisStore) DeleteJob

func (s *RedisStore) DeleteJob(id string) error

func (*RedisStore) GetAllJobs

func (s *RedisStore) GetAllJobs() ([]agscheduler.Job, error)

func (*RedisStore) GetJob

func (s *RedisStore) GetJob(id string) (agscheduler.Job, error)

func (*RedisStore) GetNextRunTime

func (s *RedisStore) GetNextRunTime() (time.Time, error)

func (*RedisStore) Init

func (s *RedisStore) Init() error

func (*RedisStore) UpdateJob

func (s *RedisStore) UpdateJob(j agscheduler.Job) error

Jump to

Keyboard shortcuts

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