builder

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CommandAvailable

func CommandAvailable(name string) bool

func DefaultLintConfig

func DefaultLintConfig() build.LintConfig

func DefaultTestConfig

func DefaultTestConfig() build.TestConfig

Types

type BuildOptions

type BuildOptions struct {
	Target  string
	Version string
	Race    bool
	GOOS    string
	GOARCH  string
}

type BuildSummary

type BuildSummary struct {
	Target        string
	Results       []*build.BuildResult
	SuccessCount  int
	TotalDuration time.Duration
	TotalSize     int64
}

type CleanOptions

type CleanOptions struct {
	All       bool
	Cache     bool
	ModCache  bool
	TestCache bool
}

type Config

type Config struct {
	BinaryCLI    string
	BinaryAlias  string
	BinDir       string
	CmdCLIDir    string
	CoverageFile string
	CoverageHTML string
	DockerImage  string
	Version      string
	BuildDate    string
	GitCommit    string
}

Config holds builder configuration.

func DefaultConfig

func DefaultConfig(version, buildDate, gitCommit string) *Config

DefaultConfig returns default configuration for Juleson project

type InstallOptions

type InstallOptions struct {
	Path       string
	SkipBuild  bool
	SkipChecks bool
	SkipLint   bool
	SkipTests  bool
}

type InstallResult

type InstallResult = build.InstallResult

type QualityOptions

type QualityOptions struct {
	Format       bool
	UseGofumpt   bool
	FormatPaths  []string
	Lint         bool
	LintConfig   build.LintConfig
	Test         bool
	TestConfig   build.TestConfig
	Build        bool
	BuildOptions BuildOptions
}

type QualitySummary

type QualitySummary struct {
	Checks       []string
	LintResult   *build.LintResult
	TestResult   *build.TestResult
	BuildSummary *BuildSummary
}

type Service

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

Service coordinates project-level builder workflows.

func NewService

func NewService(config *Config) *Service

NewService creates a new builder service.

func (*Service) BuildAll

func (s *Service) BuildAll(ctx context.Context) error

BuildAll builds all configured binaries.

func (*Service) BuildCLI

func (s *Service) BuildCLI(ctx context.Context) error

BuildCLI builds the CLI binary.

func (*Service) BuildWithResults

func (s *Service) BuildWithResults(ctx context.Context, options BuildOptions) (*BuildSummary, error)

func (*Service) Clean

func (s *Service) Clean(ctx context.Context) error

Clean removes generated build artifacts and coverage files.

func (*Service) CleanArtifacts

func (s *Service) CleanArtifacts(ctx context.Context, options CleanOptions) ([]string, error)

func (*Service) Coverage

func (s *Service) Coverage(ctx context.Context) error

Coverage generates test coverage report

func (*Service) DockerBuild

func (s *Service) DockerBuild(ctx context.Context) error

DockerBuild builds the Docker image

func (*Service) DockerClean

func (s *Service) DockerClean(ctx context.Context) error

DockerClean cleans Docker artifacts

func (*Service) DockerComposeDown

func (s *Service) DockerComposeDown(ctx context.Context) error

DockerComposeDown stops services with docker-compose

func (*Service) DockerComposeUp

func (s *Service) DockerComposeUp(ctx context.Context) error

DockerComposeUp starts services with docker-compose

func (*Service) DockerPush

func (s *Service) DockerPush(ctx context.Context) error

DockerPush pushes the Docker image to the registry

func (*Service) DockerRun

func (s *Service) DockerRun(ctx context.Context, args []string) error

DockerRun runs a Docker container with the given arguments

func (*Service) DockerRunCLI

func (s *Service) DockerRunCLI(ctx context.Context, args []string) error

DockerRunCLI runs the CLI in a Docker container

func (*Service) DownloadDeps

func (s *Service) DownloadDeps(ctx context.Context) error

DownloadDeps downloads Go module dependencies

func (*Service) Format

func (s *Service) Format(ctx context.Context) error

Format formats the codebase

func (*Service) FormatCode

func (s *Service) FormatCode(ctx context.Context, useGofumpt bool, paths ...string) error

func (*Service) GenerateCoverageHTML

func (s *Service) GenerateCoverageHTML(ctx context.Context, config build.TestConfig, outputPath string) error

func (*Service) GetVersion

func (s *Service) GetVersion() VersionInfo

GetVersion returns version information

func (*Service) Install

func (s *Service) Install(ctx context.Context, targetPath string) error

Install installs binaries to the target path (defaults to GOPATH/bin)

func (*Service) InstallWithResult

func (s *Service) InstallWithResult(ctx context.Context, options InstallOptions) (*build.InstallResult, error)

func (*Service) Lint

func (s *Service) Lint(ctx context.Context) error

Lint runs linters on the codebase

func (*Service) LintWithResult

func (s *Service) LintWithResult(ctx context.Context, config build.LintConfig) *build.LintResult

func (*Service) ReleaseWithResults

func (s *Service) ReleaseWithResults(ctx context.Context, version string) (*BuildSummary, error)

func (*Service) RunAllChecks

func (s *Service) RunAllChecks(ctx context.Context) error

RunAllChecks runs all quality checks (lint, test, build)

func (*Service) RunCLI

func (s *Service) RunCLI(ctx context.Context, args []string) error

RunCLI runs the CLI binary with the given arguments

func (*Service) RunModuleMaintenance

func (s *Service) RunModuleMaintenance(ctx context.Context, operation string, packages ...string) error

func (*Service) RunQualityChecks

func (s *Service) RunQualityChecks(ctx context.Context, options QualityOptions) (*QualitySummary, error)

func (*Service) RunTestsWithResult

func (s *Service) RunTestsWithResult(ctx context.Context, config build.TestConfig) *build.TestResult

func (*Service) StartDev

func (s *Service) StartDev(ctx context.Context) error

StartDev starts development mode with live reload (requires air)

func (*Service) Test

func (s *Service) Test(ctx context.Context, options TestOptions) error

Test runs tests with the given options

func (*Service) TidyDeps

func (s *Service) TidyDeps(ctx context.Context) error

TidyDeps tidies Go module dependencies

func (*Service) WithOutput

func (s *Service) WithOutput(stdout, stderr io.Writer) *Service

WithOutput sets custom output writers for stdout and stderr

type TestOptions

type TestOptions struct {
	Verbose  bool
	Race     bool
	Cover    bool
	Short    bool
	Packages []string
}

TestOptions holds options for running tests

type VersionInfo

type VersionInfo struct {
	Version   string
	BuildDate string
	GitCommit string
}

VersionInfo holds version information

Jump to

Keyboard shortcuts

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