mock

package
v1.4.23 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2018 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package mock provides a library, mocking Fritz!Box backend.

Example

Start a new mock server.

package main

import (
	"github.com/bpicode/fritzctl/mock"
)

func main() {
	m := mock.New()
	m.DeviceList = "path/to/devicelist.xml"
	m.Start()
	defer m.Close()
}
Output:

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Fritz

type Fritz struct {
	LoginChallengeResponse string
	LoginResponse          string
	DeviceList             string
	Logs                   string
	LanDevices             string
	InetStats              string
	PhoneCalls             string
	SystemStatus           string
	Server                 *httptest.Server
}

Fritz represents the mock of the FB. codebeat:disable[TOO_MANY_IVARS]

func New

func New() *Fritz

New creates a new *mock.Fritz with default configuration.

func (*Fritz) Close

func (f *Fritz) Close()

Close closes the server.

func (*Fritz) Start

func (f *Fritz) Start() *Fritz

Start creates and starts the server.

func (*Fritz) UnstartedServer

func (f *Fritz) UnstartedServer() *httptest.Server

UnstartedServer sets up the routes and creates a server.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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