package bidirule
import "golang.org/x/text/secure/bidirule"
Package bidirule implements the Bidi Rule defined by RFC 5893.
This package is under development. The API may change without notice and without preserving backward compatibility.
Index ¶
- Variables
- func Direction(b []byte) bidi.Direction
- func DirectionString(s string) bidi.Direction
- func Valid(b []byte) bool
- func ValidString(s string) bool
- type Transformer
Variables ¶
ErrInvalid indicates a label is invalid according to the Bidi Rule.
Functions ¶
func Direction ¶
Direction reports the direction of the given label as defined by RFC 5893. The Bidi Rule does not have to be applied to labels of the category LeftToRight.
func DirectionString ¶
DirectionString reports the direction of the given label as defined by RFC 5893. The Bidi Rule does not have to be applied to labels of the category LeftToRight.
func Valid ¶
Valid reports whether b conforms to the BiDi rule.
func ValidString ¶
ValidString reports whether s conforms to the BiDi rule.
Types ¶
type Transformer ¶
type Transformer struct {
// contains filtered or unexported fields
}
Transformer implements transform.Transform.
func New ¶
func New() *Transformer
New returns a Transformer that verifies that input adheres to the Bidi Rule.
func (*Transformer) Reset ¶
func (t *Transformer) Reset()
Reset implements transform.Transformer.
func (*Transformer) Span ¶
func (t *Transformer) Span(src []byte, atEOF bool) (n int, err error)
Span returns the first n bytes of src that conform to the Bidi rule.
func (*Transformer) Transform ¶
func (t *Transformer) Transform(dst, src []byte, atEOF bool) (nDst, nSrc int, err error)
Transform implements transform.Transformer. This Transformer has state and needs to be reset between uses.
Source Files ¶
bidirule.go bidirule10.0.0.go
- Version
- v0.22.0 (latest)
- Published
- Feb 4, 2025
- Platform
- linux/amd64
- Imports
- 4 packages
- Last checked
- 1 day ago –
Tools for package owners.