common

package
v6.0.4 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CutRight

func CutRight(s, sep string) (before, after string, found bool)

CutRight slices string around the last occurrence of sep returning the text before and after sep. The found result reports whether sep appears in s. If sep does not appear in s, cut returns s, "", false.

func SmartJoin

func SmartJoin(elems ...string) string

SmartJoin is similar to strings.Join except it skips empty strings and the separator is always a white space. Useful for formatting configuration stanzas with only 1 memory allocation.

func SplitRequest

func SplitRequest(parts []string) (command, condition []string)

SplitRequest searches for "if" or "unless" and returns result

func StringExtractComment

func StringExtractComment(s string) string

StringExtractComment checks if comment is added

func StringSplitIgnoreEmpty

func StringSplitIgnoreEmpty(s string, separators ...rune) []string

StringSplitIgnoreEmpty while spliting, removes empty items

func StringSplitWithCommentIgnoreEmpty

func StringSplitWithCommentIgnoreEmpty(s string) (data []string, comment string)

StringSplitWithCommentIgnoreEmpty while splitting, removes empty items, if we have comment, separate it

Types

type Expression

type Expression struct {
	Expr []string
}

Expression is standard HAProxy expression formed by a sample-fetch followed by some converters.

func (*Expression) Parse

func (e *Expression) Parse(expression []string) error

func (*Expression) String

func (e *Expression) String() string

type ParserData

type ParserData interface{}

type ReturnResultLine

type ReturnResultLine struct {
	Data    string
	Comment string
}

Jump to

Keyboard shortcuts

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