Documentation
¶
Index ¶
- func ValidatePolicy(p *api.RetryPolicy) error
- type ErrRetryPolicyNotFound
- type PostgresRetryPolicyRepository
- func (r *PostgresRetryPolicyRepository) CreateRetryPolicy(ctx *armadacontext.Context, policy *api.RetryPolicy) error
- func (r *PostgresRetryPolicyRepository) DeleteRetryPolicy(ctx *armadacontext.Context, name string) ([]string, error)
- func (r *PostgresRetryPolicyRepository) GetAllRetryPolicies(ctx *armadacontext.Context) ([]*api.RetryPolicy, error)
- func (r *PostgresRetryPolicyRepository) GetRetryPolicy(ctx *armadacontext.Context, name string) (*api.RetryPolicy, error)
- func (r *PostgresRetryPolicyRepository) UpdateRetryPolicy(ctx *armadacontext.Context, policy *api.RetryPolicy) error
- type RetryPolicyRepository
- type Server
- func (s *Server) CreateRetryPolicy(grpcCtx context.Context, req *api.RetryPolicy) (*types.Empty, error)
- func (s *Server) DeleteRetryPolicy(grpcCtx context.Context, req *api.RetryPolicyDeleteRequest) (*types.Empty, error)
- func (s *Server) GetRetryPolicies(grpcCtx context.Context, _ *api.RetryPolicyListRequest) (*api.RetryPolicyList, error)
- func (s *Server) GetRetryPolicy(grpcCtx context.Context, req *api.RetryPolicyGetRequest) (*api.RetryPolicy, error)
- func (s *Server) UpdateRetryPolicy(grpcCtx context.Context, req *api.RetryPolicy) (*types.Empty, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ValidatePolicy ¶
func ValidatePolicy(p *api.RetryPolicy) error
ValidatePolicy checks that a retry policy is structurally valid, so that malformed policies are rejected at write time.
Types ¶
type ErrRetryPolicyNotFound ¶
type ErrRetryPolicyNotFound struct {
Name string
}
func (*ErrRetryPolicyNotFound) Error ¶
func (err *ErrRetryPolicyNotFound) Error() string
type PostgresRetryPolicyRepository ¶
type PostgresRetryPolicyRepository struct {
// contains filtered or unexported fields
}
func NewPostgresRetryPolicyRepository ¶
func NewPostgresRetryPolicyRepository(db *pgxpool.Pool) *PostgresRetryPolicyRepository
func (*PostgresRetryPolicyRepository) CreateRetryPolicy ¶
func (r *PostgresRetryPolicyRepository) CreateRetryPolicy(ctx *armadacontext.Context, policy *api.RetryPolicy) error
func (*PostgresRetryPolicyRepository) DeleteRetryPolicy ¶
func (r *PostgresRetryPolicyRepository) DeleteRetryPolicy(ctx *armadacontext.Context, name string) ([]string, error)
DeleteRetryPolicy removes a policy and returns the queues it was detached from. Deleting a non-existent policy is a no-op, consistent with DeleteQueue.
Attachments are deleted explicitly rather than by ON DELETE CASCADE, so RETURNING names the queues this transaction detached, and both this path and queue attachment touch queue_retry_policy before retry_policy.
func (*PostgresRetryPolicyRepository) GetAllRetryPolicies ¶
func (r *PostgresRetryPolicyRepository) GetAllRetryPolicies(ctx *armadacontext.Context) ([]*api.RetryPolicy, error)
func (*PostgresRetryPolicyRepository) GetRetryPolicy ¶
func (r *PostgresRetryPolicyRepository) GetRetryPolicy(ctx *armadacontext.Context, name string) (*api.RetryPolicy, error)
func (*PostgresRetryPolicyRepository) UpdateRetryPolicy ¶
func (r *PostgresRetryPolicyRepository) UpdateRetryPolicy(ctx *armadacontext.Context, policy *api.RetryPolicy) error
type RetryPolicyRepository ¶
type RetryPolicyRepository interface {
GetAllRetryPolicies(ctx *armadacontext.Context) ([]*api.RetryPolicy, error)
GetRetryPolicy(ctx *armadacontext.Context, name string) (*api.RetryPolicy, error)
CreateRetryPolicy(ctx *armadacontext.Context, policy *api.RetryPolicy) error
UpdateRetryPolicy(ctx *armadacontext.Context, policy *api.RetryPolicy) error
DeleteRetryPolicy(ctx *armadacontext.Context, name string) ([]string, error)
}
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func NewServer ¶
func NewServer(repository RetryPolicyRepository, authorizer auth.ActionAuthorizer) *Server
func (*Server) CreateRetryPolicy ¶
func (*Server) DeleteRetryPolicy ¶
func (*Server) GetRetryPolicies ¶
func (s *Server) GetRetryPolicies(grpcCtx context.Context, _ *api.RetryPolicyListRequest) (*api.RetryPolicyList, error)
GetRetryPolicies returns all retry policies. Reads require no permission, consistent with GetQueue.
func (*Server) GetRetryPolicy ¶
func (s *Server) GetRetryPolicy(grpcCtx context.Context, req *api.RetryPolicyGetRequest) (*api.RetryPolicy, error)
GetRetryPolicy returns a single retry policy by name. Reads require no permission, consistent with GetQueue.