http

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2020 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Overview

Package http send request to get public ip and response to dyndns provider

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// Service  string
	// URL      string
	// Insecure bool
	// Cron     bool
	// Sleep    time.Duration
	Config *viper.Viper
	IP     *net.IPAddr
	Log    *zerolog.Logger
}

Client represent an homedynip client

func NewClient

func NewClient() *Client

NewClient returns a new homedynip client

func (*Client) GetIP

func (c *Client) GetIP() (string, error)

GetIP returns the IP given by server

func (*Client) WriteDNS

func (c *Client) WriteDNS() error

WriteDNS writes IP to dyndns provider

type Server

type Server struct {
	HTTPConfig *http.Server
	Config     *viper.Viper
	Log        *zerolog.Logger
}

Server represent an homedynip server

func NewServer

func NewServer() *Server

NewServer returns a new homedynip server

func (*Server) Start

func (s *Server) Start()

Start starts the server

Jump to

Keyboard shortcuts

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