corroservice

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2026 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultUser       = "uncloud"
	DefaultGossipPort = 51001
	DefaultAPIPort    = 51002
)
View Source
const DefaultSystemdUnit = "uncloud-corrosion.service"
View Source
const (
	LatestImage = "ghcr.io/psviderski/corrosion:latest"
)

Variables

This section is empty.

Functions

func MkDataDir

func MkDataDir(dir, owner string) error

func WaitReady added in v0.10.0

func WaitReady(ctx context.Context, dataDir string) error

WaitReady waits for the Corrosion service to be ready with the uncloud schema applied.

Types

type APIConfig

type APIConfig struct {
	Addr netip.AddrPort `toml:"addr"`
}

type AdminConfig

type AdminConfig struct {
	Path string `toml:"path"`
}

type Config

type Config struct {
	DB     DBConfig     `toml:"db"`
	Gossip GossipConfig `toml:"gossip"`
	API    APIConfig    `toml:"api"`
	Admin  AdminConfig  `toml:"admin"`
}

Config represents the Corrosion config.

func (*Config) Write

func (c *Config) Write(path, owner string) error

type DBConfig

type DBConfig struct {
	Path        string   `toml:"path"`
	SchemaPaths []string `toml:"schema_paths"`
}

type DockerService

type DockerService struct {
	Client  *client.Client
	Image   string
	Name    string
	DataDir string
	User    string
}

func (*DockerService) Restart

func (s *DockerService) Restart(ctx context.Context) error

func (*DockerService) Running

func (s *DockerService) Running() bool

func (*DockerService) Start

func (s *DockerService) Start(ctx context.Context) error

func (*DockerService) Stop added in v0.10.0

func (s *DockerService) Stop(ctx context.Context) error

type GossipConfig

type GossipConfig struct {
	Addr      netip.AddrPort `toml:"addr"`
	Bootstrap []string       `toml:"bootstrap"`
	Plaintext bool           `toml:"plaintext"`
}

type Service

type Service interface {
	Start(ctx context.Context) error
	Stop(ctx context.Context) error
	Restart(ctx context.Context) error
	Running() bool
}

type SystemdService

type SystemdService struct {
	DataDir string
	Unit    string
	// contains filtered or unexported fields
}

func DefaultSystemdService

func DefaultSystemdService(dataDir string) *SystemdService

func (*SystemdService) Restart

func (s *SystemdService) Restart(ctx context.Context) error

func (*SystemdService) Running

func (s *SystemdService) Running() bool

func (*SystemdService) Start

func (s *SystemdService) Start(ctx context.Context) error

func (*SystemdService) Stop added in v0.10.0

func (s *SystemdService) Stop(_ context.Context) error

Jump to

Keyboard shortcuts

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