s3-orchestrator

admintarget

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

Package admintarget resolves the admin API base address and token from the precedence flag -> environment -> config file.

Index

Constants

EnvAddr and EnvToken let a local binary target a remote instance without a server config; flags take precedence over both.

const (
    EnvAddr  = "S3O_ADMIN_ADDR"
    EnvToken = "S3O_ADMIN_TOKEN" //nolint:gosec // G101: env var name, not a credential
)

func Resolve

func Resolve(addrFlag, tokenFlag string, loadCfg func() (*config.Config, error)) (string, string, error)

Resolve determines the admin API base address and token using the precedence flag -> environment -> config. The config file is loaded (via loadCfg) only when either value is still missing.

Generated by gomarkdoc