fritzgo

package module
v0.0.0-...-7c6a5d1 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2023 License: MIT Imports: 3 Imported by: 0

README

FritzGo

Retrieve basic information from your FRITZ!Box.

$ go run ./cmd/fritzgo/ help
NAME:
   FritzGo - CLI tool to access FRITZ!Box data

USAGE:
   FritzGo [global options] command [command options] [arguments...]

VERSION:
   <unknown> @ 1970-01-01T01:00:00+01:00

COMMANDS:
   info     
   users    
   help, h  Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --help, -h                           show help
   --log.ctx value [ --log.ctx value ]  A list of context field appended to every log. Format: key=value. [$LOG_CTX]
   --log.format value                   Specify the format of logs. Supported formats: 'logfmt', 'json', 'console' [$LOG_FORMAT]
   --log.level value                    Specify the log level. e.g. 'debug', 'info', 'error'. (default: "info") [$LOG_LEVEL]
   --version, -v                        print the version

   FRITZ!Box:

   --fritz.url value  The FRITZ!Box address. (default: "http://fritz.box") [$FRITZ_URL]

   Rendering style:

   --render.table.style value  The rendering table style. (default: "default") [$RENDER_TABLE_STYLE]

Info

Display basic information.

$ go run ./cmd/fritzgo/ info

+---------------------------------+
| Info                            |
+-------------+-------------------+
| Name        | FRITZ!Box 7530    |
| Version     | 164.07.57         |
| Mac address | A3:7D:9B:C1:4E:2A |
| URL         | http://fritz.box  |
+-------------+-------------------+

List users

Display fritz users.

$ go run ./cmd/fritzgo/ users list

+---------------------+
| List users          |
+-----------+---------+
| USER NAME | DEFAULT |
+-----------+---------+
| fritz5432 | true    |
+-----------+---------+

Documentation

Overview

Package fritzgo contains CLI tools to access fritz data.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	ListUsers(context.Context) ([]fritztypes.User, error)
	Info(context.Context) (fritztypes.Info, error)
}

Client represents an HTTP client to access fritz data.

type FritzGo

type FritzGo struct {
	// contains filtered or unexported fields
}

FritzGo is the core application to retrieve, manage and render fritz data.

func New

func New(client Client, render Renderer) *FritzGo

New returns a new application.

func (*FritzGo) Info

func (f *FritzGo) Info(ctx context.Context) error

Info retrieves and renders basic information.

func (*FritzGo) ListUsers

func (f *FritzGo) ListUsers(ctx context.Context) error

ListUsers retrieves and renders fritz users.

type Renderer

type Renderer interface {
	ListUsers([]fritztypes.User) error
	Info(fritztypes.Info) error
}

Renderer render fritz data.

Directories

Path Synopsis
cmd
Package cmd contains reusable, command-related helper functions.
Package cmd contains reusable, command-related helper functions.
fritzgo
Package main runs the agent.
Package main runs the agent.
internal
tablerend
Package tablerend renders tables.
Package tablerend renders tables.
pkg
fritzclient
Package fritzclient contains an HTTP client to access the fritz box.
Package fritzclient contains an HTTP client to access the fritz box.
fritzclient/middleware
Package middleware contains routing middleware.
Package middleware contains routing middleware.
fritzcrypt
Package fritzcrypt decrypts fritz secrets.
Package fritzcrypt decrypts fritz secrets.
fritztypes
Package fritztypes contains fritz types.
Package fritztypes contains fritz types.

Jump to

Keyboard shortcuts

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