config

package
v0.0.0-...-2ad5e84 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const ToMainSlackNotify = "main"
View Source
const ToPaymentLogSlackNotify = "payment_log"
View Source
const ToPaymentSlackNotify = "payment"

Variables

View Source
var BaseStripeUrl = "https://dashboard.stripe.com"
View Source
var IsDebug = false

Functions

func CheckIncludeNTTTemplate

func CheckIncludeNTTTemplate(data string) error

func CheckIncludePreferredAPTemplate

func CheckIncludePreferredAPTemplate(data string) error

func CheckIncludeV4RouteTemplate

func CheckIncludeV4RouteTemplate(data string) error

func CheckIncludeV4Template

func CheckIncludeV4Template(data string) error

func CheckIncludeV6RouteTemplate

func CheckIncludeV6RouteTemplate(data string) error

func CheckIncludeV6Template

func CheckIncludeV6Template(data string) error

func GetConfig

func GetConfig(inputConfPath string) error

Types

type Admin

type Admin struct {
	IP        string    `json:"ip"`
	Port      int       `json:"port"`
	ReturnURL string    `json:"return_url"`
	AdminAuth AdminAuth `json:"auth"`
}

type AdminAuth

type AdminAuth struct {
	User string `json:"user"`
	Pass string `json:"pass"`
}

type Auth

type Auth struct {
	Token1 string `json:"token1"`
	Token2 string `json:"token2"`
	Token3 string `json:"token3"`
}

type Config

type Config struct {
	Controller Controller `json:"controller"`
	Web        Web        `json:"web"`
	DB         DB         `json:"db"`
	Stripe     Stripe     `json:"stripe"`
	Mail       MailServer `json:"mail"`
	JPNIC      JPNIC      `json:"jpnic"`
	Radius     Radius     `json:"radius"`
	Slack      Slack      `json:"slack"`
	Log        Log        `json:"log"`
	Template   Template   `json:"template"`
}
var Conf Config

type ConnectionTemplate

type ConnectionTemplate struct {
	Name             string `json:"name"`
	Type             string `json:"type"`
	Comment          string `json:"comment"`
	NeedInternet     bool   `json:"need_internet"`
	NeedComment      bool   `json:"need_comment"`
	NeedCrossConnect bool   `json:"need_cross_connect"`
	IsL2             bool   `json:"is_l2"`
	IsL3             bool   `json:"is_l3"`
}

func GetConnectionTemplate

func GetConnectionTemplate(connectionType string) (*ConnectionTemplate, error)

type Controller

type Controller struct {
	User     User   `json:"user"`
	Admin    Admin  `json:"admin"`
	Auth     Auth   `json:"auth"`
	TimeZone string `json:"timezone"`
}

type DB

type DB struct {
	IP     string `json:"ip"`
	Port   int    `json:"port"`
	User   string `json:"user"`
	Pass   string `json:"pass"`
	DBName string `json:"dbName"`
}

type JPNIC

type JPNIC struct {
	URL            string `json:"url"`
	V4CertFilePath string `json:"v4_cert_file_path"`
	V4KeyFilePath  string `json:"v4_key_file_path"`
	V6CertFilePath string `json:"v6_cert_file_path"`
	V6KeyFilePath  string `json:"v6_key_file_path"`
	CAFilePath     string `json:"ca_file_path"`
}

type Log

type Log struct {
	Path string `json:"path"`
}

type MailServer

type MailServer struct {
	Host     string `json:"host"`
	Port     int    `json:"port"`
	From     string `json:"from"`
	CC       string `json:"cc"`
	Contract string `json:"contract"`
	User     string `json:"user"`
	Pass     string `json:"pass"`
}

type MailTemplate

type MailTemplate struct {
	ID      string `json:"id"`
	Title   string `json:"title"`
	Message string `json:"message"`
}

func GetMailTemplate

func GetMailTemplate(id string) (*MailTemplate, error)

type MembershipTemplate

type MembershipTemplate struct {
	Title   string `json:"title"`
	Plan    string `json:"plan"`
	PriceID string `json:"price_id"`
	Fee     string `json:"fee"`
}

func GetMembershipTemplate

func GetMembershipTemplate(plan string) (*MembershipTemplate, error)

type Radius

type Radius struct {
	Host string `json:"host"`
	Port int    `json:"port"`
	User string `json:"user"`
	Pass string `json:"pass"`
}

type ServiceTemplate

type ServiceTemplate struct {
	Hidden       bool   `json:"hidden"`
	Name         string `json:"name"`
	Type         string `json:"type"`
	Comment      string `json:"comment"`
	NeedJPNIC    bool   `json:"need_jpnic"`
	NeedGlobalAS bool   `json:"need_global_as"`
	NeedComment  bool   `json:"need_comment"`
	NeedRoute    bool   `json:"need_route"`
	NeedBGP      bool   `json:"need_bgp"`
}

func GetServiceTemplate

func GetServiceTemplate(serviceType string) (*ServiceTemplate, error)

type Slack

type Slack struct {
	AppToken string        `json:"app_token"`
	BotToken string        `json:"bot_token"`
	Channels SlackChannels `json:"channels"`
}

type SlackChannels

type SlackChannels struct {
	Main       string `json:"main"`
	Log        string `json:"log"`
	Payment    string `json:"payment"`
	PaymentLog string `json:"payment_log"`
}

type Stripe

type Stripe struct {
	WebhookSecretKey string `json:"webhook_secret_key"`
	SecretKey        string `json:"secret_key"`
	IsTest           bool   `json:"is_test"`
}

type Template

type Template struct {
	Service     []ServiceTemplate    `json:"service"`
	Connection  []ConnectionTemplate `json:"connection"`
	Membership  []MembershipTemplate `json:"membership"`
	NTT         []string             `json:"NTT"`
	V4          []string             `json:"v4"`
	V6          []string             `json:"v6"`
	V4Route     []string             `json:"v4_route"`
	V6Route     []string             `json:"v6_route"`
	PreferredAP []string             `json:"preferred_ap"`
	Mail        []MailTemplate       `json:"mail"`
}

type User

type User struct {
	IP        string `json:"ip"`
	Port      int    `json:"port"`
	Url       string `json:"url"`
	ReturnURL string `json:"return_url"`
}

type Web

type Web struct {
	URL string `json:"url"`
}

Jump to

Keyboard shortcuts

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