sanitize

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 16, 2019 License: BSD-3-Clause Imports: 7 Imported by: 30

README

go-sanitize

A Go port of the Flamework lib_sanitize library.

Install

You will need to have both Go (specifically version 1.12 or higher because we're using Go modules) and the make programs installed on your computer.

All of this package's dependencies are bundled with the code in the vendor directory.

Example

package main

import (
       "fmt"
       "sanitize"
       )

func main() {

     input := "foo bar\nbaz ok:'\u2318' bad:'\u0007' bad:'\u206E' woop woop"
     
     opts := sanitize.DefaultOptions()
     output, _ := sanitize.SanitizeString(input, opts)

     fmt.Println(output)

}

See also

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SanitizeFloat64

func SanitizeFloat64(input string) (float64, error)

func SanitizeInt32

func SanitizeInt32(input string) (int32, error)

func SanitizeInt64

func SanitizeInt64(input string) (int64, error)

func SanitizeString

func SanitizeString(input string, options *Options) (string, error)

Types

type Options

type Options struct {
	StripReserved bool
	AllowNewlines bool
	// contains filtered or unexported fields
}

func DebugOptions

func DebugOptions() *Options

func DefaultOptions

func DefaultOptions() *Options

Jump to

Keyboard shortcuts

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