mailstack

package
v0.0.0-...-c85e528 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2025 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

@openapi 3.0.0

@openapi 3.0.0

@openapi 3.0.0

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddDNSRecord

func AddDNSRecord(s *cosapi_services.Services) gin.HandlerFunc

func ConfigureDomain

func ConfigureDomain(services *cosapi_services.Services) gin.HandlerFunc

ConfigureDomain configures DNS for an existing domain @Summary Configure domain DNS @Description Sets up DNS records and mail services for an existing domain @Tags Domains @Accept json @Produce json @Param body body ConfigureDomainRequest true "Domain configuration details" @Success 201 {object} DomainResponse "Domain configured successfully" @Failure 400 {object} handlers.ErrorResponse "Invalid request - Missing required fields or invalid format" @Failure 401 {object} handlers.ErrorResponse "Unauthorized - Missing or invalid API key" @Failure 404 {object} handlers.ErrorResponse "Not Found - Domain not found or not owned by tenant" @Failure 500 {object} handlers.ErrorResponse "Internal server error - Configuration failed or service unavailable" @Router /mailstack/v1/domains/configure [post] @Security ApiKeyAuth

func DeleteDNSRecord

func DeleteDNSRecord(s *cosapi_services.Services) gin.HandlerFunc

func GetDomains

func GetDomains(services *cosapi_services.Services) gin.HandlerFunc

GetDomains retrieves all active domains @Summary List active domains @Description Retrieves all active domains for the authenticated tenant @Tags Domains @Accept json @Produce json @Success 200 {object} DomainsResponse "Successfully retrieved domain list" @Failure 401 {object} handlers.ErrorResponse "Unauthorized - Missing or invalid API key" @Failure 500 {object} handlers.ErrorResponse "Internal server error - Unable to retrieve domains" @Router /mailstack/v1/domains [get] @Security ApiKeyAuth

func GetMailboxes

func GetMailboxes(services *cosapi_services.Services) gin.HandlerFunc

GetMailboxes retrieves all mailboxes for a domain @Summary List mailboxes @Description Retrieves all mailboxes configured for the specified domain @Tags Mailboxes @Accept json @Produce json @Param domain path string true "Domain name" example(example.com) @Success 200 {object} MailboxesResponse "Successfully retrieved mailboxes" @Failure 400 {object} handlers.ErrorResponse "Missing domain parameter" @Failure 401 {object} handlers.ErrorResponse "Unauthorized - Missing or invalid API key" @Failure 404 {object} handlers.ErrorResponse "Domain not found" @Failure 500 {object} handlers.ErrorResponse "Internal server error" @Router /domains/{domain}/mailboxes [get] @Security ApiKeyAuth

func RecommendDomain

func RecommendDomain(s *cosapi_services.Services) gin.HandlerFunc

func RegisterNewDomain

func RegisterNewDomain(services *cosapi_services.Services) gin.HandlerFunc

RegisterNewDomain registers a new domain for mail service @Summary Register new domain @Description Registers and configures a new domain for mail services, including DNS setup @Tags Domains @Accept json @Produce json @Param body body RegisterNewDomainRequest true "Domain registration details" @Success 201 {object} DomainResponse "Domain registered and configured successfully" @Failure 400 {object} handlers.ErrorResponse "Invalid request - Missing required fields or invalid format" @Failure 401 {object} handlers.ErrorResponse "Unauthorized - Missing or invalid API key" @Failure 406 {object} handlers.ErrorResponse "Not Acceptable - Domain TLD not supported or premium domain" @Failure 409 {object} handlers.ErrorResponse "Conflict - Domain already registered" @Failure 500 {object} handlers.ErrorResponse "Internal server error - Configuration failed or service unavailable" @Router /mailstack/v1/domains [post] @Security ApiKeyAuth

func RegisterNewMailbox

func RegisterNewMailbox(services *cosapi_services.Services) gin.HandlerFunc

RegisterNewMailbox creates a new mailbox for a domain @Summary Create mailbox @Description Creates a new mailbox for the specified domain with optional forwarding and webmail access @Tags Mailboxes @Accept json @Produce json @Param domain path string true "Domain name" example(example.com) @Param body body MailboxRequest true "Mailbox configuration" @Success 200 {object} MailboxResponse "Mailbox created successfully" @Success 200 {object} MailboxResponse "Mailbox created successfully with generated password" @Failure 400 {object} handlers.ErrorResponse "Invalid request - Missing or invalid parameters" @Failure 401 {object} handlers.ErrorResponse "Unauthorized - Missing or invalid API key" @Failure 404 {object} handlers.ErrorResponse "Domain not found" @Failure 409 {object} handlers.ErrorResponse "Mailbox already exists" @Failure 500 {object} handlers.ErrorResponse "Internal server error" @Router /domains/{domain}/mailboxes [post] @Security ApiKeyAuth

Types

type ConfigureDomainRequest

type ConfigureDomainRequest struct {
	// Domain name to configure
	// required: true
	// pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]{1,61}[a-zA-Z0-9]\.[a-zA-Z]{2,}$
	// example: example.com
	Domain string `json:"domain"`

	// Website URL for domain configuration
	// required: true
	// format: uri
	// example: https://www.example.com
	Website string `json:"website"`
}

ConfigureDomainRequest represents the domain configuration request @Description Request payload for configuring domain DNS and mail services

type DNSRecord

type DNSRecord struct {
	ID      string `json:"id"`
	Type    string `json:"type"`
	Name    string `json:"name"`
	Content string `json:"content"`
}

type DNSRecordResponse

type DNSRecordResponse struct {
	enum.BaseResponse
	Record DNSRecord `json:"dnsRecord"`
}

type DNSResponse

type DNSResponse struct {
	enum.BaseResponse
	Records []DNSRecord `json:"dnsRecords"`
}

type DomainRecommendationResponse

type DomainRecommendationResponse struct {
	enum.BaseResponse
	Domains []string `json:"domains"`
}

type DomainRecord

type DomainRecord struct {
	// Registered domain name
	// required: true
	// example: example.com
	Domain string `json:"domain"`

	// Domain registration date
	// required: true
	// format: date
	// example: 2024-09-14
	CreatedDate string `json:"createdDate"`

	// Domain expiration date
	// required: true
	// format: date
	// example: 2025-09-14
	ExpiredDate string `json:"expiredDate"`

	// List of assigned nameservers
	// required: true
	// minItems: 2
	// example: ["ns1.example.com","ns2.example.com"]
	Nameservers []string `json:"nameservers"`
}

DomainRecord represents detailed domain information @Description Comprehensive domain record information

type DomainResponse

type DomainResponse struct {
	// Inherits standard response fields
	enum.BaseResponse
	// Domain information
	// required: true
	Domain DomainRecord `json:"domain"`
}

DomainResponse represents a single domain response @Description Response containing domain details and status

type DomainsResponse

type DomainsResponse struct {
	// Inherits standard response fields
	enum.BaseResponse
	// List of domains
	// required: true
	Domains []DomainRecord `json:"domains"`
}

DomainsResponse represents multiple domains response @Description Response containing list of domains and status

type MailboxRecord

type MailboxRecord struct {
	// Email address for the mailbox
	// required: true
	// format: email
	// example: user@example.com
	Email string `json:"email"`

	// Mailbox password (only included in specific responses)
	// required: false
	// minLength: 8
	// maxLength: 64
	Password string `json:"password,omitempty"`

	// Email forwarding status
	// required: true
	// default: false
	ForwardingEnabled bool `json:"forwardingEnabled"`

	// List of forwarding email addresses
	// required: false
	// maxItems: 10
	ForwardingTo []string `json:"forwardingTo"`

	// Webmail access status
	// required: true
	// default: false
	WebmailEnabled bool `json:"webmailEnabled"`
}

MailboxRecord represents detailed mailbox information @Description Comprehensive mailbox configuration and status

type MailboxRequest

type MailboxRequest struct {
	// Username for the mailbox
	// required: true
	// pattern: ^[a-zA-Z0-9._%+-]+$
	// minLength: 3
	// maxLength: 64
	// example: john.doe
	Username string `json:"username"`

	// Password for mailbox access
	// required: false
	// minLength: 8
	// maxLength: 64
	// example: SecurePassword123!
	Password string `json:"password"`

	// List of email addresses to forward to
	// required: false
	// maxItems: 10
	// example: ["user1@example.com","user2@example.com"]
	ForwardingTo []string `json:"forwardingTo"`

	// Enable webmail access
	// required: false
	// default: false
	WebmailEnabled bool `json:"webmailEnabled"`

	// Associated user's email address
	// required: false
	// format: email
	// example: john.doe@mycompany.com
	LinkedUser string `json:"linkedUser"`
}

MailboxRequest represents mailbox creation request @Description Request payload for creating and configuring a new mailbox

type MailboxResponse

type MailboxResponse struct {
	// Inherits standard response fields
	enum.BaseResponse
	// Mailbox information
	// required: false
	Mailbox MailboxRecord `json:"mailbox,omitempty"`
}

MailboxResponse represents single mailbox response @Description Response containing mailbox details and status

type MailboxesResponse

type MailboxesResponse struct {
	// Inherits standard response fields
	enum.BaseResponse
	// List of mailboxes
	// required: false
	Mailboxes []MailboxRecord `json:"mailboxes,omitempty"`
}

MailboxesResponse represents multiple mailboxes response @Description Response containing list of mailboxes and status

type RegisterNewDomainRequest

type RegisterNewDomainRequest struct {
	// Domain name to register
	// required: true
	// pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]{1,61}[a-zA-Z0-9]\.[a-zA-Z]{2,}$
	// example: example.com
	Domain string `json:"domain"`

	// Website URL for domain configuration
	// required: true
	// format: uri
	// example: https://www.example.com
	Website string `json:"website"`
}

RegisterNewDomainRequest represents the domain registration request @Description Request payload for registering a new domain for mail services

Jump to

Keyboard shortcuts

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