value

package
v1.11.1 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package value provides diffferent implementations to retrieve the value to replace while updating files.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileValuer

type FileValuer struct {
	Path string
}

FileValuer is a valuer that returns the content of a specific file.

func (FileValuer) Value

func (v FileValuer) Value(_ context.Context, repoPath string) (string, error)

Value returns the value to replace while updating files in the given repository.

type StringValuer

type StringValuer string

StringValuer is a valuer to replace a string.

func (StringValuer) Value

func (v StringValuer) Value(_ context.Context, _ string) (string, error)

Value returns the value to replace while updating files in the given repository.

type Valuer

type Valuer interface {
	// Value returns the value to replace while updating files in the given repository.
	Value(ctx context.Context, repoPath string) (string, error)
}

Valuer is the interface for retrieving a value to replace while updating files.

func ParseValuer

func ParseValuer(valueStr string) (Valuer, error)

ParseValuer parses the valuer defined as string - from the CLI for example - and returns a properly formatted valuer.

Jump to

Keyboard shortcuts

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