scheduler_config_storage

package
v1.15.0 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2024 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DbConfig added in v1.15.0

type DbConfig struct {
	Host     string `bson:"host"`
	Port     int32  `bson:"port"`
	User     string `bson:"user"`
	Password string `bson:"password"`
	DbName   string `bson:"dbName"`
	Cluster  string `bson:"cluster"`
}

type GrpcConfig

type GrpcConfig struct {
	Service string `bson:"service"`
	Host    string `bson:"host"`
	Port    int32  `bson:"port"`
}

type HTTPConfig

type HTTPConfig struct {
	Method     string            `bson:"string"`
	URL        string            `bson:"url"`
	Headers    map[string]string `bson:"headers"`
	StatusCode int32             `bson:"statusCode"`
}

type HTTPValueConfig

type HTTPValueConfig struct {
	Method    string            `bson:"method"`
	URL       string            `bson:"url"`
	Headers   map[string]string `bson:"headers"`
	Selectors []*Selectors      `bson:"selectors"`
}

type SchedulerConfig

type SchedulerConfig struct {
	ID                  primitive.ObjectID    `bson:"_id"`
	Name                string                `bson:"name,omitempty"`
	Type                apiPb.SchedulerType   `bson:"type"`
	Status              apiPb.SchedulerStatus `bson:"status"`
	Interval            int32                 `bson:"interval"`
	Timeout             int32                 `bson:"timeout"`
	TCPConfig           *TCPConfig            `bson:"tcpConfig,omitempty"`
	SiteMapConfig       *SiteMapConfig        `bson:"siteMapConfig,omitempty"`
	GrpcConfig          *GrpcConfig           `bson:"grpcConfig,omitempty"`
	HTTPConfig          *HTTPConfig           `bson:"httpConfig,omitempty"`
	HTTPValueConfig     *HTTPValueConfig      `bson:"httpValueConfig,omitempty"`
	SslExpirationConfig *SslExpirationConfig  `bson:"sslExpirationConfig,omitempty"`
	Db                  *DbConfig             `bson:"db"`
}

type Selectors

type Selectors struct {
	Type apiPb.HttpJsonValueConfig_JsonValueParseType `bson:"type"`
	Path string                                       `bson:"path"`
}

type SiteMapConfig

type SiteMapConfig struct {
	URL         string `bson:"url"`
	Concurrency int32  `bson:"concurrency"`
}

type SslExpirationConfig

type SslExpirationConfig struct {
	Host string `bson:"host"`
	Port int32  `bson:"port"`
}

type Storage

type Storage interface {
	Get(ctx context.Context, schedulerID primitive.ObjectID) (*SchedulerConfig, error)
	Add(ctx context.Context, config *SchedulerConfig) error
	Remove(ctx context.Context, schedulerID primitive.ObjectID) error
	Run(ctx context.Context, schedulerID primitive.ObjectID) error
	Stop(ctx context.Context, schedulerID primitive.ObjectID) error
	GetAll(ctx context.Context) ([]*SchedulerConfig, error)
	GetAllForSync(ctx context.Context) ([]*SchedulerConfig, error)
}

func New

func New(
	connector mongo_helper.Connector,
) Storage

type TCPConfig

type TCPConfig struct {
	Host string `bson:"host"`
	Port int32  `bson:"port"`
}

Jump to

Keyboard shortcuts

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