util

package
v0.0.0-...-b051cd3 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2021 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const COLLECTIONNAME = "jobs"

Variables

This section is empty.

Functions

This section is empty.

Types

type DatabaseHandler

type DatabaseHandler struct {
	DB             *mongo.Client
	Collection     *mongo.Collection
	K8sClient      *kubernetes.Clientset
	BaseKey        string
	UserDataBucket string
	DBBucket       string
	Namespace      string
	ExpiryTime     int64
}

func InitDatabaseHandler

func InitDatabaseHandler() (*DatabaseHandler, error)

func (*DatabaseHandler) DeleteJob

func (handler *DatabaseHandler) DeleteJob(id string) error

func (*DatabaseHandler) ListExpiredJobs

func (handler *DatabaseHandler) ListExpiredJobs() ([]*Job, error)

func (*DatabaseHandler) ListRunningJobs

func (handler *DatabaseHandler) ListRunningJobs() ([]*Job, error)

type Job

type Job struct {
	JobID       string
	Secret      string
	K8sID       string
	Updated     primitive.Timestamp
	Created     primitive.Timestamp
	Status      string
	DataBucket  string
	FastaKey    string
	ProdigalKey string
	RepliconKey string
	ResultKey   string
	Error       string
	ExpiryDate  primitive.Timestamp
	ConfString  string
	IsDeleted   bool
	Jobname     string
}

Job The database model for a bakta job

type K8sHandler

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

func InitSimpleScheduler

func InitSimpleScheduler() (*K8sHandler, error)

func (*K8sHandler) DeleteK8sJob

func (handler *K8sHandler) DeleteK8sJob(jobID string) error

type S3ObjectStorageHandler

type S3ObjectStorageHandler struct {
	S3Client   *s3.Client
	S3Endpoint string
}

func InitS3ObjectStorageHandler

func InitS3ObjectStorageHandler() (*S3ObjectStorageHandler, error)

func (*S3ObjectStorageHandler) DeleteObject

func (handler *S3ObjectStorageHandler) DeleteObject(bucket string, key string) error

Jump to

Keyboard shortcuts

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