Skip to content

Go library for accessing the Mail-in-a-Box API

License

Notifications You must be signed in to change notification settings

nrdcg/mailinabox

Repository files navigation

Go library for accessing the Mail-in-a-Box API

Build Status PkgGoDev Go Report Card

A Mail-in-a-Box API client written in Go.

mailinabox is a Go client library for accessing the Mail-in-a-Box API.

Examples

package main

import (
	"context"
	"fmt"

	"github.com/nrdcg/mailinabox"
)

func main() {
	client, err := mailinabox.NewClient("https://example.com", "[email protected]", "secret")
	if err != nil {
		panic(err)
	}

	record := mailinabox.Record{
		Name:  "example.com",
		Type:  "A",
		Value: "10.0.0.1",
	}

	resp, err := client.DNS.AddRecord(context.Background(), record)
	if err != nil {
		panic(err)
	}

	fmt.Println(resp)
}
package mailinabox_test

import (
	"context"
	"fmt"

	"github.com/nrdcg/mailinabox"
)

func main() {
	client, err := mailinabox.NewClient("https://example.com", "[email protected]", "secret")
	if err != nil {
		panic(err)
	}

	resp, err := client.System.Reboot(context.Background())
	if err != nil {
		panic(err)
	}

	fmt.Println(resp)
}

API Documentation

Supported APIs

  • User API
  • Mail API
  • DNS API
  • SSL API
  • Web API
  • MFA API
  • System API