cmd

package
v0.0.0-...-5e476a9 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2026 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LocalInterfaceAddress = "127.0.0.1"
)

Variables

View Source
var CLI = Cmd{}
View Source
var DefaultInstanceForHut = "sr.ht"
View Source
var RandPort = minPort + rand.IntN(65536-minPort)

Functions

func Build

func Build(conf man.Config) error

func CreateBundlePackage

func CreateBundlePackage(conf man.Config) error

func Serve

func Serve(conf man.Config, listenAddr string) error

func Upload

func Upload(conf man.Config, instance, domain string) error

Types

type BuildCmd

type BuildCmd struct {
	Target string `flag:"" help:"The path where to generate the bundle for the wiki repository."`
	Dev    bool   `flag:"" help:"Don't optimize resulting assets." negatable:"" default:"true"`
}

func (BuildCmd) Run

func (b BuildCmd) Run(ctx Context) error

type Cmd

type Cmd struct {
	Verbose bool      `flag:"" name:"verbose" short:"v" aliases:"vv,vvv" optional:"" negatable:""`
	Path    *os.File  `flag:"" help:"The path for the wiki repository."`
	Build   BuildCmd  `cmd:"" help:"Build the static HTML version for the wiki."`
	Serve   ServeCmd  `cmd:"" help:"Build the static HTML version for the wiki and serve it locally."`
	Upload  UploadCmd `cmd:"" help:"Build the static HTML version for the wiki and upload it to srht.site pages."`
}

type Context

type Context struct {
	Logger *slog.Logger
}

type ServeCmd

type ServeCmd struct {
	BuildCmd
	Listen string `flag:"" hidden:"" help:"Listen on this address."`
}

func (ServeCmd) Run

func (s ServeCmd) Run(ctx Context) error

type UploadCmd

type UploadCmd struct {
	BuildCmd
	Domain   string `flag:"" help:"The sr.ht domain where to publish the bundle."`
	Instance string `flag:"" help:"The sr.ht instance where to publish." default:"${defaultSrHtInstance}"`
}

func (UploadCmd) Run

func (u UploadCmd) Run(ctx Context) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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