stateloader

package
v1.14.2 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2023 License: Apache-2.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

View Source
const RecommendedSectionEnd = "END OF AUTOGENERATED SECTION BY SYNCER"
View Source
const RecommendedSectionStart = "THIS SECTION IS AUTOGENERATED BY SYNCER, DO NOT EDIT"

Variables

This section is empty.

Functions

func ContainsSubstring

func ContainsSubstring(substring string) func(string) bool

func FilterEmptyStrings

func FilterEmptyStrings(s string) bool

func LoadAllState

func LoadAllState(ctx context.Context, paths []files.Path, loader StateLoader) (*files.System[*files.State], error)

func SyncedFiles

func SyncedFiles(ctx context.Context, g git.Git, loader StateLoader, loc string, syncFlag string) (*files.System[*files.State], error)

Types

type ParseConfig

type ParseConfig struct {
	SplitBy       string
	StartSection  func(string) bool
	EndSection    func(string) bool
	SectionTrim   func(string) string
	SectionSorter func([]string)
	Filter        func(string) bool
}

func RecommendedNewlineSeparatedConfig

func RecommendedNewlineSeparatedConfig() ParseConfig

type ParseResult

type ParseResult struct {
	State          *files.State
	PreAutogenMsg  string
	AutogenMsg     string
	PostAutogenMsg string
}

func Parse

func Parse(ctx context.Context, loader StateLoader, path files.Path, conf ParseConfig) (*ParseResult, error)

type StateLoader

type StateLoader interface {
	LoadState(ctx context.Context, path files.Path) (*files.State, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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