s3-orchestrator

initcmd

import "github.com/afreidah/s3-orchestrator/internal/cli/initcmd"

Package initcmd implements the `s3-orchestrator init` subcommand, which interactively walks an operator through writing a baseline config.yaml suitable for first boot.

Index

func GenerateConfig

func GenerateConfig(params *Params) (string, error)

GenerateConfig renders the config template with the given parameters.

func Run

func Run(args []string, in io.Reader, out, errOut io.Writer) int

Run is the CLI entry point. It parses the init flags, runs the interactive generator, and returns the process exit code.

func RunInteractive

func RunInteractive(configPath string, in io.Reader, out io.Writer) error

RunInteractive drives the interactive config generation flow. Exposed for tests that want to feed canned input through the prompter.

type Backend

Backend holds a single backend’s configuration inputs.

type Backend struct {
    Name             string
    Endpoint         string
    Bucket           string
    AccessKeyID      string
    SecretAccessKey  string
    ForcePathStyle   bool
    QuotaBytes       string
    APIRequestLimit  string
    EgressByteLimit  string
    IngressByteLimit string
}

type Bucket

Bucket holds a single virtual bucket’s configuration inputs.

type Bucket struct {
    Name            string
    AccessKeyID     string
    SecretAccessKey string
}

type Params

Params holds the collected user inputs for config generation.

type Params struct {
    Driver     string
    DBPath     string
    DBHost     string
    DBPort     string
    DBName     string
    DBUser     string
    DBPassword string
    Backends   []Backend
    Buckets    []Bucket
}

Generated by gomarkdoc