Documentation
¶
Index ¶
- func AddReqRes(ngsi *ngsilib.NGSI, r MockHTTPReqRes)
- func GetStderrString(c *ngsicli.Context) string
- func GetStdoutString(c *ngsicli.Context) string
- func MockGetReader(s string) (ngsilib.FileLib, error)
- func MockGetReaderError(s string) (ngsilib.FileLib, error)
- func MockReadAll(s string) (bytes []byte, err error)
- func MockReadAllError(s string) (bytes []byte, err error)
- func NewHttpHeader(key, value string) http.Header
- func SetClientHTTP(c *ngsicli.Context, reqRes ...MockHTTPReqRes)
- func SetFilePatAbsError(ngsi *ngsilib.NGSI, p int)
- func SetJSONDecodeErr(ngsi *ngsilib.NGSI, p int)
- func SetJSONEncodeErr(ngsi *ngsilib.NGSI, p int)
- func SetJSONIndentError(ngsi *ngsilib.NGSI)
- func SetReadFileError(ngsi *ngsilib.NGSI, p int)
- func SetupTest(app *ngsicli.App, args []string) *ngsicli.Context
- func SetupTestInitCmd(callback func(*ngsilib.NGSI)) *ngsicli.Context
- func SetupTestInitNGSI() *ngsilib.NGSI
- func SetupTestWithConfig(app *ngsicli.App, args []string, config string) *ngsicli.Context
- func SetupTestWithConfigAndCache(app *ngsicli.App, args []string, config, cache string) *ngsicli.Context
- func StrPtr(s string) *string
- func UrlParse(s string) *url.URL
- type MockFileLib
- func (f *MockFileLib) Close() error
- func (f *MockFileLib) File() bufio.Reader
- func (f *MockFileLib) FilePathAbs(path string) (string, error)
- func (f *MockFileLib) Open(path string) (err error)
- func (f *MockFileLib) ReadAll(r io.Reader) ([]byte, error)
- func (f *MockFileLib) ReadFile(filename string) ([]byte, error)
- func (f *MockFileLib) SetReader(r io.Reader)
- type MockFilePathLib
- type MockHTTP
- type MockHTTPReqRes
- type MockIoLib
- func (io *MockIoLib) Close() error
- func (io *MockIoLib) Decode(v interface{}) error
- func (io *MockIoLib) Encode(v interface{}) error
- func (io *MockIoLib) FileName() *string
- func (io *MockIoLib) FilePathAbs(path string) (string, error)
- func (io *MockIoLib) FilePathJoin(elem ...string) string
- func (io *MockIoLib) Getenv(key string) string
- func (io *MockIoLib) MkdirAll(path string, perm os.FileMode) error
- func (io *MockIoLib) Open() (err error)
- func (io *MockIoLib) OpenFile(flag int, perm os.FileMode) (err error)
- func (io *MockIoLib) SetFileName(filename *string)
- func (io *MockIoLib) Stat(filename string) (os.FileInfo, error)
- func (io *MockIoLib) Truncate(size int64) error
- func (io *MockIoLib) UserConfigDir() (string, error)
- func (io *MockIoLib) UserHomeDir() (string, error)
- type MockIoutilLib
- func (i *MockIoutilLib) Copy(dst io.Writer, src io.Reader) (int64, error)
- func (i *MockIoutilLib) ReadFile(filename string) ([]byte, error)
- func (i *MockIoutilLib) ReadFull(r io.Reader, buf []byte) (n int, err error)
- func (i *MockIoutilLib) WriteFile(filename string, data []byte, perm os.FileMode) error
- type MockJSONLib
- type MockMultiPart
- type MockMultiPartLib
- type MockNetLib
- type MockSyslogLib
- type MockTimeLib
- type MockZipFile
- type MockZipLib
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddReqRes ¶
func AddReqRes(ngsi *ngsilib.NGSI, r MockHTTPReqRes)
func GetStderrString ¶
func GetStdoutString ¶
func MockReadAllError ¶
func NewHttpHeader ¶
func SetClientHTTP ¶
func SetClientHTTP(c *ngsicli.Context, reqRes ...MockHTTPReqRes)
func SetFilePatAbsError ¶
func SetJSONDecodeErr ¶
func SetJSONEncodeErr ¶
func SetJSONIndentError ¶
func SetReadFileError ¶
func SetupTestInitNGSI ¶
func SetupTestWithConfig ¶
Types ¶
type MockFileLib ¶
type MockFileLib struct { Name string OpenError error CloseError error ReadallError error ReadallData []byte FilePathAbsString string FilePathAbsError [5]error ReadFileData []byte ReadFileError [5]error FileError *bufio.Reader FileError2 *bufio.Reader IoReader *bufio.Reader // contains filtered or unexported fields }
func (*MockFileLib) Close ¶
func (f *MockFileLib) Close() error
func (*MockFileLib) File ¶
func (f *MockFileLib) File() bufio.Reader
func (*MockFileLib) FilePathAbs ¶
func (f *MockFileLib) FilePathAbs(path string) (string, error)
func (*MockFileLib) Open ¶
func (f *MockFileLib) Open(path string) (err error)
func (*MockFileLib) SetReader ¶
func (f *MockFileLib) SetReader(r io.Reader)
type MockFilePathLib ¶
type MockFilePathLib struct {
PathAbsErr error
}
func (*MockFilePathLib) FilePathAbs ¶
func (i *MockFilePathLib) FilePathAbs(path string) (string, error)
func (*MockFilePathLib) FilePathBase ¶
func (i *MockFilePathLib) FilePathBase(path string) string
func (*MockFilePathLib) FilePathJoin ¶
func (i *MockFilePathLib) FilePathJoin(elem ...string) string
type MockHTTP ¶
type MockHTTP struct { ReqRes []MockHTTPReqRes // contains filtered or unexported fields }
MockHTTPReqRes is ...
func NewMockHTTP ¶
func NewMockHTTP() *MockHTTP
type MockHTTPReqRes ¶
type MockIoLib ¶
type MockIoLib struct { OpenErr error EncodeErr error Filename *string HomeDir error PathAbs error StatErr error Tokens *string TruncIndex int Trunc []error }
func (*MockIoLib) FilePathJoin ¶
func (*MockIoLib) SetFileName ¶
func (*MockIoLib) UserConfigDir ¶
func (*MockIoLib) UserHomeDir ¶
type MockIoutilLib ¶
type MockIoutilLib struct { CopyErr error ReadFullErr error ReadFullData []byte WriteFileErr error ReadFileErr error ReadFileData []byte WriteSkip bool }
type MockJSONLib ¶
type MockJSONLib struct { IndentErr error ValidErr *bool Jsonlib ngsilib.JSONLib DecodeErr [5]error EncodeErr [5]error // contains filtered or unexported fields }
func (*MockJSONLib) Valid ¶
func (j *MockJSONLib) Valid(data []byte) bool
type MockMultiPart ¶
func (*MockMultiPart) NewWriter ¶
func (m *MockMultiPart) NewWriter(w io.Writer) ngsilib.MultiPartLib
type MockMultiPartLib ¶
func (MockMultiPartLib) Close ¶
func (m MockMultiPartLib) Close() error
func (MockMultiPartLib) CreatePart ¶
func (m MockMultiPartLib) CreatePart(header textproto.MIMEHeader) (io.Writer, error)
func (MockMultiPartLib) FormDataContentType ¶
func (m MockMultiPartLib) FormDataContentType() string
type MockNetLib ¶
func (*MockNetLib) InterfaceAddrs ¶
func (n *MockNetLib) InterfaceAddrs() ([]net.Addr, error)
func (*MockNetLib) ListenAndServe ¶
func (n *MockNetLib) ListenAndServe(addr string, handler http.Handler) error
func (*MockNetLib) ListenAndServeTLS ¶
func (n *MockNetLib) ListenAndServeTLS(addr, certFile, keyFile string, handler http.Handler) error
type MockSyslogLib ¶
type MockTimeLib ¶
func (*MockTimeLib) Format ¶
func (t *MockTimeLib) Format(layout string) string
func (*MockTimeLib) Now ¶
func (t *MockTimeLib) Now() time.Time
func (*MockTimeLib) NowUnix ¶
func (t *MockTimeLib) NowUnix() int64
type MockZipFile ¶
type MockZipFile struct { }
func (*MockZipFile) DataOffset ¶
func (f *MockZipFile) DataOffset() (offset int64, err error)
func (*MockZipFile) Open ¶
func (f *MockZipFile) Open() (io.ReadCloser, error)
Click to show internal directories.
Click to hide internal directories.