scanner

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package scanner is a multi line block scanner for YAML input bytes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Inp []byte
}

type Scanner

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

func New

func New(c Config) *Scanner

func (*Scanner) Append

func (s *Scanner) Append(pre []byte, suf []byte) *Scanner

func (*Scanner) Bytes

func (s *Scanner) Bytes() []byte

Bytes returns the input bytes that this scanner is conigured with.

func (*Scanner) Delete

func (s *Scanner) Delete(key []byte, sub ...byte) *Scanner

Delete tries to drop the entire YAML block identified by the given key line, e.g. " Service:". A new scanner configured without the found YAML block as input bytes is returned. Optionally a substituion slice may be defined, which causes Delete to replace the matched block with the given structure.

func (*Scanner) Search

func (s *Scanner) Search(key []byte) *Scanner

Search tries to find the entire YAML block identified by the given key line, e.g. " Service:". A new scanner configured with the found YAML block as input bytes is returned.

Jump to

Keyboard shortcuts

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