Documentation ¶
Index ¶
- func UpdateShardState(nodeID string, shardIndex int, jobState *model.JobState, ...) error
- type GenericSQLDatastore
- func (d *GenericSQLDatastore) AddEvent(ctx context.Context, jobID string, ev model.JobEvent) error
- func (d *GenericSQLDatastore) AddJob(ctx context.Context, j *model.Job) error
- func (d *GenericSQLDatastore) AddLocalEvent(ctx context.Context, jobID string, ev model.JobLocalEvent) error
- func (d *GenericSQLDatastore) GetDB() *sql.DB
- func (d *GenericSQLDatastore) GetJob(ctx context.Context, id string) (*model.Job, error)
- func (d *GenericSQLDatastore) GetJobEvents(ctx context.Context, id string) ([]model.JobEvent, error)
- func (d *GenericSQLDatastore) GetJobLocalEvents(ctx context.Context, id string) ([]model.JobLocalEvent, error)
- func (d *GenericSQLDatastore) GetJobState(ctx context.Context, jobID string) (model.JobState, error)
- func (d *GenericSQLDatastore) GetJobs(ctx context.Context, query localdb.JobQuery) ([]*model.Job, error)
- func (d *GenericSQLDatastore) GetJobsCount(ctx context.Context, query localdb.JobQuery) (int, error)
- func (d *GenericSQLDatastore) GetMigrations() (*migrate.Migrate, error)
- func (d *GenericSQLDatastore) HasLocalEvent(ctx context.Context, jobID string, eventFilter localdb.LocalEventFilter) (bool, error)
- func (d *GenericSQLDatastore) MigrateDown() error
- func (d *GenericSQLDatastore) MigrateUp() error
- func (d *GenericSQLDatastore) UpdateJobDeal(ctx context.Context, jobID string, deal model.Deal) error
- func (d *GenericSQLDatastore) UpdateShardState(ctx context.Context, jobID, nodeID string, shardIndex int, ...) error
- type GenericSQLSuite
- func (suite *GenericSQLSuite) SetupTest()
- func (suite *GenericSQLSuite) TearDownSuite()
- func (suite *GenericSQLSuite) TestAddingTwoJobs()
- func (suite *GenericSQLSuite) TestGetJobs()
- func (suite *GenericSQLSuite) TestJobEvents()
- func (suite *GenericSQLSuite) TestJobState()
- func (suite *GenericSQLSuite) TestRoundtripJob()
- func (suite *GenericSQLSuite) TestSQLiteMigrations()
- func (suite *GenericSQLSuite) TestUpdateDeal()
- type SQLClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func UpdateShardState ¶
Types ¶
type GenericSQLDatastore ¶
type GenericSQLDatastore struct {
// contains filtered or unexported fields
}
func NewGenericSQLDatastore ¶
func (*GenericSQLDatastore) AddLocalEvent ¶
func (d *GenericSQLDatastore) AddLocalEvent(ctx context.Context, jobID string, ev model.JobLocalEvent) error
func (*GenericSQLDatastore) GetDB ¶
func (d *GenericSQLDatastore) GetDB() *sql.DB
func (*GenericSQLDatastore) GetJobEvents ¶
func (*GenericSQLDatastore) GetJobLocalEvents ¶
func (d *GenericSQLDatastore) GetJobLocalEvents(ctx context.Context, id string) ([]model.JobLocalEvent, error)
func (*GenericSQLDatastore) GetJobState ¶
func (*GenericSQLDatastore) GetJobsCount ¶
func (*GenericSQLDatastore) GetMigrations ¶
func (d *GenericSQLDatastore) GetMigrations() (*migrate.Migrate, error)
func (*GenericSQLDatastore) HasLocalEvent ¶
func (d *GenericSQLDatastore) HasLocalEvent(ctx context.Context, jobID string, eventFilter localdb.LocalEventFilter) (bool, error)
func (*GenericSQLDatastore) MigrateDown ¶
func (d *GenericSQLDatastore) MigrateDown() error
func (*GenericSQLDatastore) MigrateUp ¶
func (d *GenericSQLDatastore) MigrateUp() error
func (*GenericSQLDatastore) UpdateJobDeal ¶
func (*GenericSQLDatastore) UpdateShardState ¶
func (d *GenericSQLDatastore) UpdateShardState( ctx context.Context, jobID, nodeID string, shardIndex int, update model.JobShardState, ) error
type GenericSQLSuite ¶
type GenericSQLSuite struct { suite.Suite SetupHandler func() *GenericSQLDatastore TeardownHandler func() // contains filtered or unexported fields }
func (*GenericSQLSuite) SetupTest ¶
func (suite *GenericSQLSuite) SetupTest()
func (*GenericSQLSuite) TearDownSuite ¶
func (suite *GenericSQLSuite) TearDownSuite()
func (*GenericSQLSuite) TestAddingTwoJobs ¶
func (suite *GenericSQLSuite) TestAddingTwoJobs()
func (*GenericSQLSuite) TestGetJobs ¶
func (suite *GenericSQLSuite) TestGetJobs()
func (*GenericSQLSuite) TestJobEvents ¶
func (suite *GenericSQLSuite) TestJobEvents()
func (*GenericSQLSuite) TestJobState ¶
func (suite *GenericSQLSuite) TestJobState()
func (*GenericSQLSuite) TestRoundtripJob ¶
func (suite *GenericSQLSuite) TestRoundtripJob()
func (*GenericSQLSuite) TestSQLiteMigrations ¶
func (suite *GenericSQLSuite) TestSQLiteMigrations()
func (*GenericSQLSuite) TestUpdateDeal ¶
func (suite *GenericSQLSuite) TestUpdateDeal()
type SQLClient ¶
type SQLClient interface { ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error) QueryRowContext(ctx context.Context, query string, args ...any) *sql.Row QueryContext(ctx context.Context, query string, args ...any) (*sql.Rows, error) }
SQLClient is so we can pass *sql.DB and *sql.Tx to the same functions
Click to show internal directories.
Click to hide internal directories.