tagit

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultScriptTimeout = 30 * time.Second

DefaultScriptTimeout is the default timeout for script execution.

Variables

This section is empty.

Functions

This section is empty.

Types

type CmdExecutor added in v0.0.2

type CmdExecutor struct {
	Timeout time.Duration
}

func (*CmdExecutor) Execute added in v0.0.2

func (e *CmdExecutor) Execute(command string) ([]byte, error)

type CommandExecutor added in v0.0.2

type CommandExecutor interface {
	Execute(command string) ([]byte, error)
}

CommandExecutor is an interface for running commands.

type TagIt

type TagIt struct {
	ServiceID string
	Script    string
	Interval  time.Duration
	TagPrefix string
	// contains filtered or unexported fields
}

TagIt is the main struct for the tagit flow.

func New

func New(consulClient consul.Client, commandExecutor CommandExecutor, serviceID string, script string, interval time.Duration, tagPrefix string, logger *slog.Logger) *TagIt

New creates a new TagIt struct.

func (*TagIt) CleanupTags added in v0.0.2

func (t *TagIt) CleanupTags() error

CleanupTags removes all tags with the given prefix from the service.

func (*TagIt) Run

func (t *TagIt) Run(ctx context.Context)

Run will run the tagit flow and tag consul services based on the script output

Jump to

Keyboard shortcuts

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