cmd

package
v0.0.0-...-ee67b27 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2022 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SplitStatementsDateRange

func SplitStatementsDateRange(startDate, endDate time.Time, card string) []p24.StatementsOpts

SplitStatementsDateRange splits given date range into 90 intervals and make StatementsOpts for each interval. Returns slice of StatementsOpts

Types

type BalanceCmd

type BalanceCmd struct {
	CommonP24Opts
	Country        string         `short:"k" long:"country" required:"true" description:"Merchant card number"`
	ExportEncoding string         `short:"e" long:"encoding" default:"xml" choice:"xml" choice:"json" description:"Export encoding"`
	OutputFilename flags.Filename `` // nolint
	/* 145-byte string literal not displayed */
}

BalanceCmd set of flags for getting p24 merchant card balance nolint:govet // need to save command arguments order

func (*BalanceCmd) Execute

func (cmd *BalanceCmd) Execute(_ []string) error

Execute prints p24 merchant card balance, entry point for "balance" command

type BuildInfo

type BuildInfo struct {
	Version string
	Commit  string
	Date    string
}

BuildInfo about the executable

type CommonOptionsCommander

type CommonOptionsCommander interface {
	SetCommon(commonOpts CommonOpts)
	Execute(args []string) error
}

CommonOptionsCommander extends flags.Commander with SetCommon All commands should implement this interfaces

type CommonOpts

type CommonOpts struct {
	BuildInfo BuildInfo
	Debug     bool
}

CommonOpts sets externally from main, shared across all commands

func (*CommonOpts) SetCommon

func (opts *CommonOpts) SetCommon(commonOpts CommonOpts)

SetCommon satisfies CommonOptionsCommander interface and sets common option fields The method called by main for each command

type CommonP24Opts

type CommonP24Opts struct {
	ID          string        `long:"id" required:"true" description:"Merchant id"`
	Password    string        `long:"pass" required:"true" description:"Merchant password"`
	Card        string        `long:"card" required:"true" description:"Merchant card number"`
	HTTPTimeout time.Duration `long:"timeout" default:"90s" description:"http request timeout"`
	CommonOpts
}

CommonP24Opts struct with common options and funcs for p24 api commands nolint:govet // need to save command arguments order

type StatementsCmd

type StatementsCmd struct {
	CommonP24Opts
	StartDateStr    string `long:"sd" required:"true" description:"Start date of statements date range with \"dd.mm.yyyy\" layout"` // nolint
	EndDateStr      string `long:"ed" required:"true" description:"End date of statements date range with \"dd.mm.yyyy\" layout"`   // nolint
	ExportFormatStr string ``                                                                                                       // nolint
	/* 134-byte string literal not displayed */
	ExportEncoding string         `short:"e" long:"encoding" default:"xml" choice:"xml" choice:"xlsx" description:"Export encoding"`
	OutputFilename flags.Filename `` // nolint
	/* 145-byte string literal not displayed */
	// contains filtered or unexported fields
}

StatementsCmd set of flags for getting p24 merchant statements list nolint:govet // need to save command arguments order

func (*StatementsCmd) Execute

func (cmd *StatementsCmd) Execute(_ []string) error

Execute gets statements list for specified merchant, entry point for "statements" command

type VersionCmd

type VersionCmd struct {
	CommonOpts
}

VersionCmd set of flags for showing p24info version

func (*VersionCmd) Execute

func (cmd *VersionCmd) Execute(_ []string) error

Execute prints p24info cmd version, entry point for "version" command

Jump to

Keyboard shortcuts

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