Documentation ¶
Index ¶
- Constants
- func DefaultCreate(bis *api_types.InferenceService)
- func DefaultJob(job *api_types.InferenceJob, service api_types.InferenceService)
- func ValidateCreateUpdate(bis api_types.InferenceService) (errs []error)
- func ValidateJob(job api_types.InferenceJob, connGetter ConnectionGetter, ...) (valErrs []error, err error)
- func ValidateJobInput(job api_types.InferenceJob) (errs []error)
- type ConnectionGetter
- type InferenceServiceRepo
- type InferenceServiceService
- func (s *InferenceServiceService) Create(ctx context.Context, bis *api_types.InferenceService) (err error)
- func (s *InferenceServiceService) Delete(ctx context.Context, id string) (err error)
- func (s *InferenceServiceService) Get(ctx context.Context, id string) (res api_types.InferenceService, err error)
- func (s *InferenceServiceService) List(ctx context.Context, options ...filter.ListOption) (res []api_types.InferenceService, err error)
- func (s *InferenceServiceService) Update(ctx context.Context, id string, bis *api_types.InferenceService) (err error)
- type JobRepository
- type JobService
- func (s *JobService) Create(ctx context.Context, bij *api_types.InferenceJob) (err error)
- func (s *JobService) Delete(ctx context.Context, id string) error
- func (s *JobService) Get(ctx context.Context, id string) (api_types.InferenceJob, error)
- func (s *JobService) List(ctx context.Context, options ...filter.ListOption) ([]api_types.InferenceJob, error)
- func (s *JobService) SetDeletionMark(ctx context.Context, id string) error
- func (s *JobService) UpdateStatus(ctx context.Context, id string, status api_types.InferenceJobStatus) error
- type ServiceRepository
Constants ¶
View Source
const ( EmptyServiceJobField = `field "%s"" must be set for BatchInferenceJob or as a default for a corresponding BatchInferenceService` ConnectionNotFound = `connection from "%s" with name "%s" is not found` )
View Source
const ( EmptySpecFieldErrorMessage = "%s must be non-empty" IDLengthExceeded = "ID length must be less or equal to %d" )
Variables ¶
This section is empty.
Functions ¶
func DefaultCreate ¶
func DefaultCreate(bis *api_types.InferenceService)
func DefaultJob ¶
func DefaultJob(job *api_types.InferenceJob, service api_types.InferenceService)
func ValidateCreateUpdate ¶
func ValidateCreateUpdate(bis api_types.InferenceService) (errs []error)
func ValidateJob ¶
func ValidateJob( job api_types.InferenceJob, connGetter ConnectionGetter, service api_types.InferenceService) (valErrs []error, err error)
ValidateJob validates a job after it was defaulted by BatchInferenceService values
func ValidateJobInput ¶
func ValidateJobInput(job api_types.InferenceJob) (errs []error)
ValidateJobInput validates a job before it was defaulted by BatchInferenceService values
Types ¶
type ConnectionGetter ¶
type ConnectionGetter interface {
GetConnection(id string, encrypted bool) (*connection.Connection, error)
}
type InferenceServiceRepo ¶
type InferenceServiceRepo interface { Create(ctx context.Context, tx *sql.Tx, bis api_types.InferenceService) (err error) Get(ctx context.Context, tx *sql.Tx, id string) (res api_types.InferenceService, err error) Update(ctx context.Context, tx *sql.Tx, id string, bis api_types.InferenceService) (err error) List(ctx context.Context, tx *sql.Tx, options ...filter.ListOption) (res []api_types.InferenceService, err error) Delete(ctx context.Context, tx *sql.Tx, id string) (err error) }
type InferenceServiceService ¶
type InferenceServiceService struct {
// contains filtered or unexported fields
}
func NewInferenceServiceService ¶
func NewInferenceServiceService(repo InferenceServiceRepo) *InferenceServiceService
func (*InferenceServiceService) Create ¶
func (s *InferenceServiceService) Create( ctx context.Context, bis *api_types.InferenceService) (err error)
Create creates api_types.InferenceService
func (*InferenceServiceService) Delete ¶
func (s *InferenceServiceService) Delete(ctx context.Context, id string) (err error)
func (*InferenceServiceService) Get ¶
func (s *InferenceServiceService) Get(ctx context.Context, id string) (res api_types.InferenceService, err error)
func (*InferenceServiceService) List ¶
func (s *InferenceServiceService) List( ctx context.Context, options ...filter.ListOption) (res []api_types.InferenceService, err error)
func (*InferenceServiceService) Update ¶
func (s *InferenceServiceService) Update( ctx context.Context, id string, bis *api_types.InferenceService) (err error)
Update updates api_types.InferenceService
type JobRepository ¶
type JobRepository interface { Create(ctx context.Context, tx *sql.Tx, bij api_types.InferenceJob) (err error) UpdateStatus(ctx context.Context, tx *sql.Tx, id string, s api_types.InferenceJobStatus) (err error) Delete(ctx context.Context, tx *sql.Tx, id string) (err error) List(ctx context.Context, tx *sql.Tx, options ...filter.ListOption) (res []api_types.InferenceJob, err error) Get(ctx context.Context, tx *sql.Tx, id string) (res api_types.InferenceJob, err error) SetDeletionMark(ctx context.Context, tx *sql.Tx, id string, value bool) error }
type JobService ¶
type JobService struct {
// contains filtered or unexported fields
}
func NewJobService ¶
func NewJobService(repo JobRepository, sRepo ServiceRepository, connGetter ConnectionGetter) *JobService
func (*JobService) Create ¶
func (s *JobService) Create(ctx context.Context, bij *api_types.InferenceJob) (err error)
Create launches BatchInferenceJob Because we ensure immutability of jobs we also generate ID to take this responsibility from client Generated ID should be returned to client
func (*JobService) Get ¶
func (s *JobService) Get(ctx context.Context, id string) (api_types.InferenceJob, error)
func (*JobService) List ¶
func (s *JobService) List(ctx context.Context, options ...filter.ListOption) ([]api_types.InferenceJob, error)
func (*JobService) SetDeletionMark ¶
func (s *JobService) SetDeletionMark(ctx context.Context, id string) error
func (*JobService) UpdateStatus ¶
func (s *JobService) UpdateStatus(ctx context.Context, id string, status api_types.InferenceJobStatus) error
type ServiceRepository ¶
Click to show internal directories.
Click to hide internal directories.