bootstrap

package
v0.0.0-...-78b6ac7 Latest Latest
Warning

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

Go to latest
Published: May 31, 2024 License: Apache-2.0 Imports: 24 Imported by: 0

README

This module is responsible to configure Swiftwave Service. It will expose a public API to setup system for the first time. It should not do any operations if system already configured.

Disposable email list has been taken from https://github.com/disposable-email-domains/disposable-email-domains Thanks @disposable-email-domains for making this list available publicly.

Documentation

Index

Constants

View Source
const (
	LocalRegistry   ImageRegistryType      = "local"
	RemoteRegistry  ImageRegistryType      = "remote"
	LocalPubsub     PubsubType             = "local"
	RemotePubsub    PubsubType             = "remote"
	LocalTaskQueue  TaskQueueType          = "local"
	RemoteTaskQueue TaskQueueType          = "remote"
	AMQP            TaskQueueQueueProtocol = "amqp"
	AMQPS           TaskQueueQueueProtocol = "amqps"
	AmqpQueue       RemoteTaskQueueType    = "amqp"
	RedisQueue      RemoteTaskQueueType    = "redis"
	NoneRemoteQueue RemoteTaskQueueType    = "none"
)

Variables

This section is empty.

Functions

func FetchSystemConfigHandler

func FetchSystemConfigHandler(c echo.Context) error

FetchSystemConfigHandler : Fetch system configuration handler GET /config/system

func IsSystemSetupRequired

func IsSystemSetupRequired() (bool, error)

func StartBootstrapServer

func StartBootstrapServer() error

func SystemSetupHandler

func SystemSetupHandler(c echo.Context) error

SystemSetupHandler : System setup handler POST /setup

func UpdateSystemConfigHandler

func UpdateSystemConfigHandler(c echo.Context) error

UpdateSystemConfigHandler : Update system configuration handler PUT /config/system

Types

type AmqpConfig

type AmqpConfig struct {
	Protocol TaskQueueQueueProtocol `json:"protocol"`
	Host     string                 `json:"host"`
	Port     uint                   `json:"port"`
	Username string                 `json:"username"`
	Password string                 `json:"password"`
	Vhost    string                 `json:"vhost"`
}

type HAProxyConfig

type HAProxyConfig struct {
	Image    string `json:"image"`
	Username string `json:"-"`
	Password string `json:"-"`
}

type ImageRegistryConfig

type ImageRegistryConfig struct {
	Type      ImageRegistryType `json:"type"`
	Endpoint  string            `json:"endpoint"`
	Namespace string            `json:"namespace"`
	Username  string            `json:"username"`
	Password  string            `json:"password"`
}

type ImageRegistryType

type ImageRegistryType string

type LetsEncryptConfig

type LetsEncryptConfig struct {
	EmailAddress string `json:"email_address"`
	StagingEnv   bool   `json:"staging_env"`
	PrivateKey   string `json:"-"`
}

type NewAdminCredential

type NewAdminCredential struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

type PubsubConfig

type PubsubConfig struct {
	Type         PubsubType  `json:"type"`
	BufferLength uint        `json:"buffer_length"`
	RedisConfig  RedisConfig `json:"redis_config"`
}

type PubsubType

type PubsubType string

type PvBackupConfig

type PvBackupConfig struct {
	S3Config S3Config `json:"s3_config"`
}

type RedisConfig

type RedisConfig struct {
	Host     string `json:"host"`
	Port     uint   `json:"port"`
	Password string `json:"password"`
	Database uint   `json:"database"`
}

type RemoteTaskQueueType

type RemoteTaskQueueType string

type S3Config

type S3Config struct {
	Enabled        bool   `json:"enabled"`
	Endpoint       string `json:"endpoint"`
	Region         string `json:"region"`
	BucketName     string `json:"bucket_name"`
	AccessKeyId    string `json:"access_key_id"`
	SecretKey      string `json:"secret_key"`
	ForcePathStyle bool   `json:"force_path_style"`
}

type SystemConfigurationPayload

type SystemConfigurationPayload struct {
	NetworkName          string              `json:"network_name"`
	ExtraRestrictedPorts string              `json:"extra_restricted_ports"`
	JWTSecretKey         string              `json:"-"`
	SSHPrivateKey        string              `json:"-"`
	LetsEncrypt          LetsEncryptConfig   `json:"lets_encrypt"`
	ImageRegistry        ImageRegistryConfig `json:"image_registry"`
	HAProxyConfig        HAProxyConfig       `json:"haproxy_config"`
	UDPProxyConfig       UDPProxyConfig      `json:"udpproxy_config"`
	PvBackupConfig       PvBackupConfig      `json:"pv_backup_config"`
	PubsubConfig         PubsubConfig        `json:"pubsub_config"`
	TaskQueueConfig      TaskQueueConfig     `json:"task_queue_config"`
	NewAdminCredential   NewAdminCredential  `json:"new_admin_credential"`
}

type TaskQueueConfig

type TaskQueueConfig struct {
	Type                           TaskQueueType       `json:"type"`
	RemoteTaskQueueType            RemoteTaskQueueType `json:"remote_task_queue_type" gorm:"default:'none'"`
	MaxOutstandingMessagesPerQueue uint                `json:"max_outstanding_messages_per_queue"`
	NoOfWorkersPerQueue            uint                `json:"no_of_workers_per_queue"`
	AmqpConfig                     AmqpConfig          `json:"amqp_config"`
	RedisConfig                    RedisConfig         `json:"redis_config"`
}

type TaskQueueQueueProtocol

type TaskQueueQueueProtocol string

type TaskQueueType

type TaskQueueType string

type UDPProxyConfig

type UDPProxyConfig struct {
	Image string `json:"image"`
}

Jump to

Keyboard shortcuts

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