common

package
v4.2.1 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2023 License: Apache-2.0 Imports: 1 Imported by: 4

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 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