Documentation ¶
Index ¶
- Constants
- Variables
- func ApplySubdomain(ctx context.Context, db *pgxpool.Pool, apihost, apitoken string, ...) error
- func AssembleAppPath(app string, zone string) string
- func CheckForPresence(fqdn string, ip netip.Addr, nameservers ...string) (bool, error)
- func NewDelegationList(ctx context.Context, db *pgxpool.Pool, schema string) (string, error)
- func NewKdAddrList(ctx context.Context, db *pgxpool.Pool, schema string) (string, error)
- func ParseConnEnv(connenv string) (string, string, error)
- func ParseDCNameEnv() (string, string, error)
- func ParseNSEnv(nsenv string) ([]string, error)
- func RandomCGNAT24Net() (netip.Prefix, error)
- func RandomKeydesk() (netip.Addr, error)
- func RandomULA64Net() (netip.Prefix, error)
- func RevokeSubdomain(ctx context.Context, db *pgxpool.Pool, apihost, apitoken string, domain string) error
- func SyncDelegationList(sshconf *ssh.ClientConfig, delegationSyncServer, ident, kdAddrList string) (func(string), error)
- func SyncKdAddrList(sshconf *ssh.ClientConfig, kdAddrSyncServer, ident, kdAddrList string) (func(string), error)
- func VgsCheckOrderStatus(ctx context.Context, _ *slog.Logger, db *pgxpool.Pool, ...) (string, int64, error)
- func VgsCreateBrigade(ctx context.Context, logger *slog.Logger, db *pgxpool.Pool, ...) error
- func VgsCreatePair(ctx context.Context, logger *slog.Logger, db *pgxpool.Pool, ...) error
- func VgsDeleteBrigade(ctx context.Context, logger *slog.Logger, db *pgxpool.Pool, ...) error
- func VgsDeletePair(ctx context.Context, logger *slog.Logger, db *pgxpool.Pool, ...) error
- func VgsOrderCreateBrigade(ctx context.Context, logger *slog.Logger, db *pgxpool.Pool, ...) (uuid.UUID, string, int64, error)
- func VgsOrderDeleteBrigade(ctx context.Context, logger *slog.Logger, db *pgxpool.Pool, ...) (uuid.UUID, string, int64, error)
- func VgsPopOrder(ctx context.Context, logger *slog.Logger, db *pgxpool.Pool, ...) (uuid.UUID, error)
- func WaitForDelegation(fqdn string, ip netip.Addr, ns ...string) (bool, error)
- type VgsPairsResult
- type VpnCfgs
Constants ¶
View Source
const ( DelegationSyncFilename = "domain-generate-%s.csv" DelegationSyncReloadFilename = "domain-generate.reload" )
View Source
const ( DomainCheckPause = 5 * time.Second DomainDelegationWaitTime = 120 * time.Second )
View Source
const ( KdAddrSyncFilename = "vpn-works-%s.csv" KdAddrSyncReloadFilename = "vpn-works-keydesks.reload" )
View Source
const ( BrigadeCgnatPrefix = 24 BrigadeUlaPrefix = 64 )
View Source
const ( VgsOrderStatusAccepted = "accepted" VgsOrderStatusProcessing = "processing" VgsOrderStatusFailed = "failed" VgsOrderStatusCompleted = "completed" )
View Source
const ( VgsOrderPopStatusAccepted = "accepted" VgsOrderPopStatusPairCompleted = "pair_completed" VgsOrderPopStatusBrigadeCompleted = "brigade_completed" VgsOrderPopStatusFailed = "failed" VgsOrderPopStatusCompleted = "completed" )
View Source
const DefaultRandomAttemts = 10000
View Source
const (
DefaultVgsOrderRetryAfter = 300 // seconds
)
View Source
const MAX_DNS_RETRIES = 3
View Source
const NoUseSubdomainAPIToken = "-"
View Source
const VgsActionCreateBrigade = "create_brigade"
View Source
const VgsActionDeleteBrigade = "delete_brigade"
Variables ¶
View Source
var ( ErrUnknownIP = errors.New("unknown ip address") ErrNegativeRcode = errors.New("negative rcode") ErrRetriesExceeded = errors.New("retries exceeded") )
View Source
var ( ErrEmptyConnString = errors.New("empty sync connect string") ErrInvalidConnString = errors.New("invalid sync connect string") ErrInvalidServerHost = errors.New("invalid sync server host") ErrInvalidServerPort = errors.New("invalid sync server port") ErrEmptyIdent = errors.New("empty ident") ErrEmptyID = errors.New("empty id") )
View Source
var ( ErrInvalidStatus = fmt.Errorf("invalid status") ErrInvalidAction = fmt.Errorf("invalid action") )
View Source
var ErrCheckAttemptExceeded = errors.New("check attempt exceeded")
View Source
var ErrDeleteAttemptsCountExceeded = errors.New("delete attempts count exceeded")
View Source
var ErrEmptyNSString = errors.New("empty ns connect string")
View Source
var ErrNotDelegated = errors.New("not delegated")
View Source
var ErrRandomAttemptsExceeded = errors.New("random attempts exceeded")
Functions ¶
func ApplySubdomain ¶ added in v1.9.0
func AssembleAppPath ¶ added in v1.9.19
func CheckForPresence ¶
Check for the presence of a record in the NS-servers
func NewDelegationList ¶
func NewKdAddrList ¶
func ParseDCNameEnv ¶
func ParseNSEnv ¶
func RandomCGNAT24Net ¶ added in v1.9.0
func RandomKeydesk ¶ added in v1.9.0
func RandomULA64Net ¶ added in v1.9.0
func RevokeSubdomain ¶ added in v1.9.1
func SyncDelegationList ¶
func SyncDelegationList(sshconf *ssh.ClientConfig, delegationSyncServer, ident, kdAddrList string) (func(string), error)
func SyncKdAddrList ¶
func SyncKdAddrList(sshconf *ssh.ClientConfig, kdAddrSyncServer, ident, kdAddrList string) (func(string), error)
func VgsCheckOrderStatus ¶ added in v1.9.11
func VgsCreateBrigade ¶ added in v1.9.1
func VgsCreatePair ¶ added in v1.9.1
func VgsDeleteBrigade ¶ added in v1.9.1
func VgsDeletePair ¶ added in v1.9.1
func VgsOrderCreateBrigade ¶ added in v1.9.1
func VgsOrderCreateBrigade(ctx context.Context, logger *slog.Logger, db *pgxpool.Pool, sqfmt sq.StatementBuilderType, brigadeID uuid.UUID, brigadeName string, zone string, ) (uuid.UUID, string, int64, error)
VgsOrderCreateBrigade creates an order to create a brigade.
func VgsOrderDeleteBrigade ¶ added in v1.9.1
func VgsOrderDeleteBrigade(ctx context.Context, logger *slog.Logger, db *pgxpool.Pool, sqfmt sq.StatementBuilderType, brigadeID uuid.UUID, ) (uuid.UUID, string, int64, error)
VgsOrderDeleteBrigade creates an order to create a brigade.
func VgsPopOrder ¶ added in v1.9.11
func VgsPopOrder(ctx context.Context, logger *slog.Logger, db *pgxpool.Pool, sqfmt sq.StatementBuilderType, action, status string, ) (uuid.UUID, error)
VgsPopOrder - pop order from the queue action: - vgsActionCreateBrigade
- status: accepted, pair_completed, failed, completed
- vgsActionDeleteBrigade
- status: accepted, processing, failed, completed
Types ¶
type VgsPairsResult ¶ added in v1.9.1
Click to show internal directories.
Click to hide internal directories.