endpoint

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2026 License: AGPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JSONHandler

func JSONHandler[TReq, TRes any](statusOnOK int, handler JSONHandlerFunc[TReq, TRes]) http.HandlerFunc

func MakeAdminRouter

func MakeAdminRouter(
	dbRepo domain.DomainRepo,
	dnsRecordManager *dns.DNSRecordManager,
	certMan certman.CertMan,
	logger *zap.Logger,
	sessionStore pkgsession.SessionStore,
	signingKey []byte,
	portalBaseURL string,
) chi.Router

func MakePortalRouter

func MakePortalRouter(
	domainRepo domain.DomainRepo,
	dnsRecordManager *dns.DNSRecordManager,
	certMan certman.CertMan,
	sessionStore pkgsession.SessionStore,
	signingKey []byte,
	portalBaseURL string,
	assetsFS fs.FS,
	version string,
	logger *zap.Logger,
	webhookDispatcher webhook.Dispatcher,
	lookup dns.Lookup,
) chi.Router

MakePortalRouter creates the chi router for the portal. It handles /portal/* routes: static assets, session management, and API.

Types

type AskEndpoint

type AskEndpoint struct {
	// contains filtered or unexported fields
}

func NewAskEndpoint

func NewAskEndpoint(domainRepo domain.DomainRepo) *AskEndpoint

func (*AskEndpoint) ServeHTTP

func (e *AskEndpoint) ServeHTTP(w http.ResponseWriter, r *http.Request)

type BaseDomainResponse

type BaseDomainResponse struct {
	Hostname          string `json:"hostname" yaml:"hostname"`
	TenantID          string `json:"tenant_id,omitempty" yaml:"tenant_id,omitempty"`
	OwnershipVerified bool   `json:"ownership_verified" yaml:"ownership_verified"`
	VerificationToken string `json:"verification_token,omitempty" yaml:"verification_token,omitempty"`
}

type CertAdminEndpoint

type CertAdminEndpoint struct {
	// contains filtered or unexported fields
}

func (*CertAdminEndpoint) BuildCertAdminRouter

func (e *CertAdminEndpoint) BuildCertAdminRouter() chi.Router

type CertResponse

type CertResponse struct {
	Hostname  string    `json:"hostname" yaml:"hostname"`
	NotBefore time.Time `json:"not_before" yaml:"not_before"`
	NotAfter  time.Time `json:"not_after" yaml:"not_after"`
	Issuer    string    `json:"issuer" yaml:"issuer"`
}

type DeleteDomainResponse

type DeleteDomainResponse struct {
	OK       bool   `json:"ok" yaml:"ok"`
	Hostname string `json:"hostname" yaml:"hostname"`
}

type DomainAdminEndpoint

type DomainAdminEndpoint struct {
	DNSRecordManager *dns.DNSRecordManager
	// contains filtered or unexported fields
}

func (*DomainAdminEndpoint) BuildDomainAdminRouter

func (e *DomainAdminEndpoint) BuildDomainAdminRouter() chi.Router

type DomainResponse

type DomainResponse struct {
	BaseDomainResponse
	RequiredDNSRecords []domain.DNSRecord `json:"required_dns_records,omitempty" yaml:"required_dns_records,omitempty"`
}

type HTTPError

type HTTPError struct {
	Status  int
	Message string
}

func (HTTPError) Error

func (e HTTPError) Error() string

type JSONHandlerFunc

type JSONHandlerFunc[TReq any, TRes any] func(r *http.Request, body TReq) (TRes, error)

type PokeCertResponse

type PokeCertResponse struct {
	Hostname string `json:"hostname" yaml:"hostname"`
}

type UpsertDomainRequest

type UpsertDomainRequest struct {
	TenantID          *string `json:"tenant_id,omitempty" yaml:"tenant_id,omitempty"`
	OwnershipVerified *bool   `json:"ownership_verified,omitempty" yaml:"ownership_verified,omitempty"`
}

type ZapFormatter

type ZapFormatter struct {
	Logger *zap.Logger
}

func (*ZapFormatter) NewLogEntry

func (z *ZapFormatter) NewLogEntry(r *http.Request) middleware.LogEntry

Jump to

Keyboard shortcuts

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