containers

package
v0.0.0-...-f8fee01 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2024 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContainerConfigGenerator

func ContainerConfigGenerator(
	locationURL string, locationName string, uploadIdentifier string,
	proxyAddress string, vpnRegion string) *container.Config

ContainerConfigGenerator generates the container config depending on the scrape target

func CreateContainer

func CreateContainer(containerConfig *container.Config) string

CreateContainer creates a container then returns the container ID

func PullImage

func PullImage(image string)

PullImage pulls the given image from a registry

func ReleaseProxyContainer

func ReleaseProxyContainer(containerID string)

ReleaseProxyContainer releases the lock on a proxy container

func RemoveContainer

func RemoveContainer(containerID string)

RemoveContainer removes the container with the given ID

func Scrape

func Scrape(uploadIdentifier string, targetName string, containerID string)

Scrape creates a container, runs it, tails the log and wait for it to exit, and export the file name

func TailLog

func TailLog(containerID string) io.Reader

TailLog tails the log of the container with the given ID

Types

type Container

type Container struct {
	ContainerID    *string
	TaskOwner      *string
	TargetName     *string
	URL            *string
	IPAddress      *string
	VPNRegion      *string
	ProxySOCKSPort *string
	ProxyHTTPPort  *string
}

Container information

func ListContainersByType

func ListContainersByType(containerType string) []Container

ListContainersByType lists all containers of the given type. Available container types:

  • "scraper": Lists all scraper containers.
  • "proxy": Lists all proxy containers.

Example:

scraperContainers := ListContainersByType("scraper")
proxyContainers := ListContainersByType("proxy")

type ProxyContainer

type ProxyContainer struct {
	ContainerID  string
	ProxyAddress string
	VPNRegion    string
}

ProxyContainer information

func AcquireProxyContainer

func AcquireProxyContainer() ProxyContainer

AcquireProxyContainer acquires a lock on a proxy container and returns its ID

Jump to

Keyboard shortcuts

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