deploylink

package
v1.5.10 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: Apache-2.0 Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package deploylink validates and builds "Deploy to Levelrail" links for git repositories and templates. The dashboard mirrors these rules in web/src/lib/deployLink.ts, and both run the cases in testdata/cases.json.

Index

Constants

View Source
const Path = "/deploy"

Path is the dashboard route a link opens.

Variables

This section is empty.

Functions

func HTML

func HTML(alt, link, badge string) string

HTML is the README snippet for a link and a badge image URL.

func Markdown

func Markdown(alt, link, badge string) string

Markdown is the README snippet for a link and a badge image URL.

func ParsePort

func ParsePort(s string) (int, error)

ParsePort parses a decimal port in 1 to 65535.

func ValidateBranch

func ValidateBranch(s string) error

ValidateBranch accepts a plain branch or tag name.

func ValidateName

func ValidateName(s string) error

ValidateName accepts a DNS label.

func ValidateRepo

func ValidateRepo(s string) error

ValidateRepo accepts https and ssh git URLs without credentials.

func ValidateTemplate

func ValidateTemplate(s string) error

ValidateTemplate checks the shape of a catalog template id. Whether the id exists is checked by whoever holds the catalog.

Types

type Params

type Params struct {
	Repo     string
	Branch   string
	Name     string
	Template string
	Port     int
}

Params are the values a link may carry. Env values and secrets are never part of a link, so there is deliberately no field for them.

func (Params) Query

func (p Params) Query() string

Query returns the encoded query in a fixed parameter order.

func (Params) URL

func (p Params) URL(instance string) (string, error)

URL builds the link for an instance base URL such as https://lr.example.com.

func (Params) Validate

func (p Params) Validate() error

Validate checks every set field. A link needs a repo or a template, not both.

Jump to

Keyboard shortcuts

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