pub

package module
v0.1.12 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2024 License: MIT Imports: 8 Imported by: 1

README

NAME

pub - Publish resources at specified paths

SYNOPSIS

pub [res1 path1]... [resN [pathN]]

DESCRIPTION

The pub command accepts an optional sequence of resource-path pairs. Each pair consists of a resource (res1) and a path (path1). These pairs can be repeated any number of times, including not at all. For each pair, the path is mandatory except for the last resource (resN). When the path is omitted, it defaults to "/".

EXAMPLES

Publish a directory at the default path:

$ pub .

Publish a specified port:

$ pub :8080

Publish a URL at the default path:

$ pub https://example.com

Publish at a port with a specified path, followed by a URL at the default path:

$ pub \
  :9944 /rpc/ws \
  https://polkadot.js.org/apps/

SEE ALSO

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyRules added in v0.1.10

func ApplyRules(mux *http.ServeMux, rules Rules)

func Handler added in v0.1.10

func Handler(rules Rules) http.Handler

func InferPrefix added in v0.1.12

func InferPrefix(s string) string

func Run

func Run(args []string) error

func SplitPathPrefix added in v0.1.12

func SplitPathPrefix(pp string) (path, pfx string)

Types

type Rule added in v0.1.10

type Rule struct {
	Resource string
	Path     string
	Prefix   string
}

func NewRule added in v0.1.10

func NewRule(res, path_with_prefix string) Rule

type Rules added in v0.1.10

type Rules []Rule

func Parse added in v0.1.10

func Parse(s []string) (rules Rules)

func (*Rules) Push added in v0.1.10

func (s *Rules) Push(r Rule)

Directories

Path Synopsis
cmd
pub command

Jump to

Keyboard shortcuts

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