...

Package arguments

import "github.com/maxbrunsfeld/counterfeiter/arguments"
Overview
Index

Overview ▾

type ArgumentParser

go:generate counterfeiter . ArgumentParser

type ArgumentParser interface {
    ParseArguments(...string) ParsedArguments
}

func NewArgumentParser

func NewArgumentParser(
    failHandler FailHandler,
    currentWorkingDir string,
    symlinkEvaler SymlinkEvaler,
    fileStatReader FileStatReader,
) ArgumentParser

type FailHandler

type FailHandler func(string, ...interface{})

type FileStatReader

type FileStatReader func(string) (os.FileInfo, error)

type ParsedArguments

type ParsedArguments struct {
    GenerateInterfaceAndShimFromPackageDirectory bool

    SourcePackageDir string // abs path to the dir containing the interface to fake
    PackagePath      string // package path to the package containing the interface to fake
    OutputPath       string // path to write the fake file to

    DestinationPackageName string // often the base-dir for OutputPath but must be a valid package name

    InterfaceName string // the interface to counterfeit
    FakeImplName  string // the name of the struct implementing the given interface

    PrintToStdOut bool
}

type SymlinkEvaler

type SymlinkEvaler func(string) (string, error)