app

package
v0.0.0-...-d79564b Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const ContextKey = "app-context"

ContextKey is used to store the initialized context in the CLI metadata map.

Variables

This section is empty.

Functions

func GetMerchantCode

func GetMerchantCode(cmd *cli.Command, flagName string) (string, error)

GetMerchantCode retrieves the merchant code from the command flag, falling back to the stored context if the flag is not set.

Types

type Context

type Context struct {
	Client          *sumup.Client
	JSONOutput      bool
	ExactTimestamps bool
	Locale          string
	MerchantCode    string
	Output          io.Writer
	StatusOutput    io.Writer
}

Context carries shared dependencies for commands.

func GetAppContext

func GetAppContext(cmd *cli.Command) (*Context, error)

GetAppContext retrieves the application context from the CLI command metadata.

func NewContext

func NewContext(apiKey, baseURL string, jsonOutput bool, exactTimestamps bool) (*Context, error)

NewContext constructs the CLI context with an initialized SumUp API client.

Jump to

Keyboard shortcuts

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