canonicalizer

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2023 License: MIT Imports: 4 Imported by: 0

README

Canonicalizer for Go

A simple canonicalizer. This is a port of Canonicalizer for PHP.

Build Status Go Report Card GoDoc go.dev

Installation

1. Installation
go get github.com/wernerdweight/canonicalizer-go

Usage

import canonicalizer "github.com/wernerdweight/canonicalizer-go"


License

This package is under the MIT license. See the complete license in the root directory of the bundle.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Canonicalizer

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

func New

func New() *Canonicalizer

func NewWithCallbacks

func NewWithCallbacks(beforeCallback func(string) string, afterCallback func(string) string) *Canonicalizer

func NewWithMaxLength

func NewWithMaxLength(maxLength int) *Canonicalizer

func NewWithMaxLengthAndCallbacks

func NewWithMaxLengthAndCallbacks(maxLength int, beforeCallback func(string) string, afterCallback func(string) string) *Canonicalizer

func (*Canonicalizer) Canonicalize

func (c *Canonicalizer) Canonicalize(str string) string

func (*Canonicalizer) CanonicalizeWithSeparator

func (c *Canonicalizer) CanonicalizeWithSeparator(str string, separator string) string

func (*Canonicalizer) CanonicalizeWithSeparatorAndSuffix

func (c *Canonicalizer) CanonicalizeWithSeparatorAndSuffix(str string, separator string, suffix string) string

func (*Canonicalizer) CanonicalizeWithSuffix

func (c *Canonicalizer) CanonicalizeWithSuffix(str string, suffix string) string

func (*Canonicalizer) SetAfterCallback

func (c *Canonicalizer) SetAfterCallback(afterCallback func(string) string)

func (*Canonicalizer) SetBeforeCallback

func (c *Canonicalizer) SetBeforeCallback(beforeCallback func(string) string)

Jump to

Keyboard shortcuts

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