segments

package
v0.125.6 Latest Latest
Warning

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

Go to latest
Published: May 5, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeSegments

func DecodeSegments(in map[string]any) (*config.ConfigNamespace[map[string]SegmentConfig, Segments], error)

Types

type SegmentConfig

type SegmentConfig struct {
	Excludes []SegmentMatcherFields
	Includes []SegmentMatcherFields
}

type SegmentFilter

type SegmentFilter interface {
	// ShouldExcludeCoarse returns whether the given fields should be excluded on a coarse level.
	ShouldExcludeCoarse(SegmentMatcherFields) bool

	// ShouldExcludeFine returns whether the given fields should be excluded on a fine level.
	ShouldExcludeFine(SegmentMatcherFields) bool
}

type SegmentMatcherFields

type SegmentMatcherFields struct {
	Kind   string
	Path   string
	Lang   string
	Output string
}

SegmentMatcherFields is a matcher for a segment include or exclude. All of these are Glob patterns.

type Segments

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

Segments is a collection of named segments.

func (Segments) Get

func (sms Segments) Get(onNotFound func(s string), ss ...string) SegmentFilter

Get returns a SegmentFilter for the given segments.

Jump to

Keyboard shortcuts

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