Back to godoc.org

Package sintls

v0.0.0-...-c3742f5
Latest Go to latest

The highest tagged major version is .

Published: Jul 13, 2020 | License: BSD-2-Clause | Module: github.com/zehome/sintls

Index

Constants

const AuthUserKey = "user"

"user" will be set on the gin context

func BasicAuth

func BasicAuth(db *pg.DB, isadmin bool) middleware.BasicAuthValidator

func LegoCleanup

func LegoCleanup(c echo.Context) error

func LegoPresent

func LegoPresent(c echo.Context) error

func OpenDB

func OpenDB(options *pg.Options, debug bool, initdb bool, runmigrations bool) (db *pg.DB, err error)

func UpdateDNSRecords

func UpdateDNSRecords(c echo.Context) error

type Authorization

type Authorization struct {
	AuthorizationId uint64       `pg:"authorization_id,pk"`
	CreatedAt       time.Time    `pg:"created_at,notnull,default:now()"`
	UpdatedAt       time.Time    `pg:"updated_at,notnull,default:now()"`
	Name            string       `pg:"name,notnull,unique"`
	Secret          string       `pg:"secret,notnull"`
	Admin           sql.NullBool `pg:"admin,notnull,default:false"`
	// contains filtered or unexported fields
}

func (*Authorization) CanUseHost

func (a *Authorization) CanUseHost(db *pg.DB, host string) bool

func (*Authorization) CreateOrUpdateHost

func (a *Authorization) CreateOrUpdateHost(
	db *pg.Tx, fqdn string,
	target_a, target_aaaa net.IP, target_cname string, target_mx string) error

func (Authorization) String

func (a Authorization) String() string

type Host

type Host struct {
	HostId         uint64    `pg:"host_id,pk"`
	CreatedAt      time.Time `pg:"created_at,notnull,default:now()"`
	UpdatedAt      time.Time `pg:"updated_at,notnull,default:now()"`
	SubDomain      *SubDomain
	SubDomainId    uint64 `pg:"subdomain_id,notnull,on_delete:CASCADE"`
	Name           string `pg:"name,notnull"`
	DnsTargetA     net.IP `pg:"dns_target_a"`
	DnsTargetAAAA  net.IP `pg:"dns_target_aaaa"`
	DnsTargetCNAME string `pg:"dns_target_cname"`
	DnsTargetMX    string `pg:"dns_target_mx"`
	// contains filtered or unexported fields
}

type LegoMessage

type LegoMessage struct {
	Domain      string `json:"domain"`
	Token       string `json:"token"`
	KeyAuth     string `json:"keyAuth"`
	TargetA     net.IP `json:"dnstarget_a,omitempty"`
	TargetAAAA  net.IP `json:"dnstarget_aaaa,omitempty"`
	TargetCNAME string `json:"dnstarget_cname,omitempty"`
	TargetMX    string `json:"dnstarget_mx,omitempty"`
}

Lego httpreq RAW request

type SubDomain

type SubDomain struct {
	SubDomainId     uint64    `pg:"subdomain_id,pk"`
	CreatedAt       time.Time `pg:"created_at,notnull,default:now()"`
	UpdatedAt       time.Time `pg:"updated_at,notnull,default:now()"`
	Authorization   *Authorization
	AuthorizationId uint64 `pg:"authorization_id,notnull,on_delete:CASCADE"`
	Name            string `pg:"name,notnull,unique"`
	// contains filtered or unexported fields
}

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier