cmd

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package cmd contains common command options and utilities

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommonOpts

type CommonOpts struct {
	Context              context.Context
	ApplicationVersion   string
	ApplicationBuildDate string
}

CommonOpts contains common options for all commands

func (*CommonOpts) SetCommonOpts

func (c *CommonOpts) SetCommonOpts(cc CommonOpts)

SetCommonOpts sets the common options

type Server

type Server struct {
	Addr     string        `long:"addr"     env:"ADDR"     description:"address to listen on" default:":8080"`
	Timeout  time.Duration `long:"timeout"  env:"TIMEOUT"  description:"HTTP client timeout"  default:"90s"`
	BaseURL  string        `long:"base-url" env:"BASE_URL" description:"base URL for webhook" required:"true"`
	Secret   string        `long:"secret"   env:"SECRET"   description:"secret for sealing webhook configurations" required:"true"`   //nolint:gosec // intentional secret field
	Password string        `long:"password" env:"PASSWORD" description:"password for basic auth, if not set, basic auth is disabled"` //nolint:gosec // intentional secret field

	CommonOpts
}

Server command starts the HTTP server.

func (Server) Execute

func (c Server) Execute([]string) error

Execute runs the command

type Version

type Version struct{ CommonOpts }

Version command prints app version

func (Version) Execute

func (v Version) Execute([]string) error

Execute prints app version

Jump to

Keyboard shortcuts

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