(ctx context.Context, params *riverdriver.LeaderInsertParams)
| 1015 | } |
| 1016 | |
| 1017 | func (e *Executor) LeaderInsert(ctx context.Context, params *riverdriver.LeaderInsertParams) (*riverdriver.Leader, error) { |
| 1018 | leader, err := dbsqlc.New().LeaderInsert(schemaTemplateParam(ctx, params.Schema), e.dbtx, &dbsqlc.LeaderInsertParams{ |
| 1019 | ElectedAt: timeStringNullable(params.ElectedAt), |
| 1020 | ExpiresAt: timeStringNullable(params.ExpiresAt), |
| 1021 | Now: timeStringNullable(params.Now), |
| 1022 | LeaderID: params.LeaderID, |
| 1023 | TTL: durationAsString(params.TTL), |
| 1024 | }) |
| 1025 | if err != nil { |
| 1026 | return nil, interpretError(err) |
| 1027 | } |
| 1028 | return leaderFromInternal(leader), nil |
| 1029 | } |
| 1030 | |
| 1031 | func (e *Executor) LeaderResign(ctx context.Context, params *riverdriver.LeaderResignParams) (bool, error) { |
| 1032 | numResigned, err := dbsqlc.New().LeaderResign(schemaTemplateParam(ctx, params.Schema), e.dbtx, &dbsqlc.LeaderResignParams{ |
nothing calls this directly
no test coverage detected