expr

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2025 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Overview

Copyright 2025 The Joe-cli Authors. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.

Copyright 2025 The Joe-cli Authors. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExpandColors

func ExpandColors(k string) any

func ExpandGlobals

func ExpandGlobals(k string) any

func Fprint

func Fprint(w io.Writer, pattern *Pattern, e Expander) (count int, err error)

func Unknown

func Unknown(s string) any

func UnknownToken

func UnknownToken(tok string) error

Types

type Expander

type Expander func(string) any

Expander converts the given string key into its variable expansion

func ComposeExpanders

func ComposeExpanders(expanders ...Expander) Expander

func ExpandMap

func ExpandMap(m map[string]any) Expander

func ExpandURL

func ExpandURL(u *url.URL) Expander

func Prefix

func Prefix(p string, e Expander) Expander

Prefix provides an expander which looks for and cuts a given prefix and delegates the result to the underlying expander

type HTTPMethod

type HTTPMethod string

HTTPMethod provides a representation of an HTTP method that supports terminal formatting

func (HTTPMethod) Color

func (m HTTPMethod) Color() string

func (HTTPMethod) Format

func (m HTTPMethod) Format(f fmt.State, verb rune)

func (HTTPMethod) String

func (m HTTPMethod) String() string

type HTTPStatus

type HTTPStatus int

HTTPStatus provides a representation of an HTTP status code that supports terminal formatting

func (HTTPStatus) Code

func (s HTTPStatus) Code() int

func (HTTPStatus) Color

func (s HTTPStatus) Color() string

func (HTTPStatus) Format

func (s HTTPStatus) Format(f fmt.State, verb rune)

func (HTTPStatus) Message

func (s HTTPStatus) Message() string

func (HTTPStatus) String

func (s HTTPStatus) String() string

type Pattern

type Pattern struct {
	// contains filtered or unexported fields
}

func Compile

func Compile(pattern string) *Pattern

func CompilePattern

func CompilePattern(pattern string, start string, end string) *Pattern

func (*Pattern) Expand

func (p *Pattern) Expand(expand Expander) string

func (*Pattern) String

func (p *Pattern) String() string

type Renderer

type Renderer struct {
	io.Writer
	// contains filtered or unexported fields
}

Renderer is a specialized writer that understands writing to multiple files and the corresponding variable support

func NewRenderer

func NewRenderer(stdout, stderr io.Writer) *Renderer

Jump to

Keyboard shortcuts

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