container

package
v0.0.0-...-4e43b7b Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Container

type Container interface {
	BuildImage() error
	RunImage(respID string) error
	StopImage(respID string) error
	CreateNewScraper(workerId string, jobId string, keyword string, dbConfig *db.DBConfig) error
	CreateNewAnalyzer(workerId string, keyword string, dbConfig *db.DBConfig) error
	CreateNewSimilarity(workerId string, dbConfig *db.DBConfig) error
	EnsureImage(image string) error
	RemoveScraper(id string) error
	RemoveAnalyzer(id string) error
}

type ContainerQueue

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

func NewContainerQueue

func NewContainerQueue(length int, containerMaximum int) *ContainerQueue

func (*ContainerQueue) DequeueFromQueue

func (q *ContainerQueue) DequeueFromQueue() *ContainerSpec

func (*ContainerQueue) DequeueFromRunning

func (q *ContainerQueue) DequeueFromRunning() *ContainerSpec

func (*ContainerQueue) EnqueueFromQueue

func (q *ContainerQueue) EnqueueFromQueue(cSpec *ContainerSpec) error

func (*ContainerQueue) EnqueueFromRunning

func (q *ContainerQueue) EnqueueFromRunning(cSpec *ContainerSpec) error

func (*ContainerQueue) GetLimitContainerCount

func (q *ContainerQueue) GetLimitContainerCount() int

func (*ContainerQueue) LenQueue

func (q *ContainerQueue) LenQueue() int

func (*ContainerQueue) LenRunning

func (q *ContainerQueue) LenRunning() int

type ContainerSpec

type ContainerSpec struct {
	WorkerId string
	JobId    string
	Keyword  string
	Token    string
	Type     string
	// for using token or api key
	InjectString string
}

type Controller

type Controller struct {
	Container
	// contains filtered or unexported fields
}

func NewController

func NewController(cQueue *ContainerQueue) (controller *Controller, err error)

func (*Controller) CountRunningCurrentScraper

func (c *Controller) CountRunningCurrentScraper(id string) (int, error)

func (*Controller) CountRunningCurrentSimilarity

func (c *Controller) CountRunningCurrentSimilarity(id string) (int, error)

func (*Controller) CreateAnalyzerService

func (c *Controller) CreateAnalyzerService(workerId, jobId, keyword string, dbConfig *db.DBConfig) (error, bool)

func (*Controller) CreateScraperService

func (c *Controller) CreateScraperService(workerId string, jobId string, keyword string, token string, dbConfig *db.DBConfig) (error, bool)

func (*Controller) CreateSimilarityService

func (c *Controller) CreateSimilarityService(workerId string, jobId string, dbConfig *db.DBConfig) (error, bool)

func (*Controller) RemoveAnalyzer

func (c *Controller) RemoveAnalyzer(id string) error

func (*Controller) RemoveScraper

func (c *Controller) RemoveScraper(id string) error

func (*Controller) RemoveSimilarity

func (c *Controller) RemoveSimilarity(id string) error

Jump to

Keyboard shortcuts

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