Documentation
¶
Index ¶
- type DomainService
- type MockErrDomainService
- func (m *MockErrDomainService) Close() error
- func (m *MockErrDomainService) CreateDomain(req model.CreateDomainRequest) (*model.DomainEntry, error)
- func (m *MockErrDomainService) DeleteDomain(domain string) error
- func (m *MockErrDomainService) GetDomain(domain string) (*model.DomainEntry, error)
- func (m *MockErrDomainService) ListDomains() ([]*model.DomainEntry, error)
- func (m *MockErrDomainService) UpdateDomain(domain string, req model.UpdateDomainRequest) (*model.DomainEntry, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DomainService ¶
type DomainService interface {
// ListDomains returns all configured domain entries.
ListDomains() ([]*model.DomainEntry, error)
// GetDomain retrieves a specific domain entry by its domain name.
GetDomain(domain string) (*model.DomainEntry, error)
// CreateDomain creates a new domain entry with the given configuration.
CreateDomain(req model.CreateDomainRequest) (*model.DomainEntry, error)
// UpdateDomain updates an existing domain entry with the given configuration.
UpdateDomain(domain string, req model.UpdateDomainRequest) (*model.DomainEntry, error)
// DeleteDomain removes a domain entry by its domain name.
DeleteDomain(domain string) error
// Close performs any necessary cleanup when the service is no longer needed.
Close() error
}
DomainService defines the interface for domain operations. It provides methods for managing domain entries in the dehydrated configuration.
type MockErrDomainService ¶
type MockErrDomainService struct{}
MockErrDomainService implements the DomainService interface for testing. It provides a simple in-memory implementation of domain operations.
func (*MockErrDomainService) Close ¶
func (m *MockErrDomainService) Close() error
Close performs cleanup for the mock service.
func (*MockErrDomainService) CreateDomain ¶
func (m *MockErrDomainService) CreateDomain(req model.CreateDomainRequest) (*model.DomainEntry, error)
CreateDomain creates a mock domain entry for testing.
func (*MockErrDomainService) DeleteDomain ¶
func (m *MockErrDomainService) DeleteDomain(domain string) error
DeleteDomain simulates deleting a domain entry for testing.
func (*MockErrDomainService) GetDomain ¶
func (m *MockErrDomainService) GetDomain(domain string) (*model.DomainEntry, error)
GetDomain returns a mock domain entry for testing.
func (*MockErrDomainService) ListDomains ¶
func (m *MockErrDomainService) ListDomains() ([]*model.DomainEntry, error)
ListDomains returns an empty list of domains for testing.
func (*MockErrDomainService) UpdateDomain ¶
func (m *MockErrDomainService) UpdateDomain(domain string, req model.UpdateDomainRequest) (*model.DomainEntry, error)
UpdateDomain updates a mock domain entry for testing.
Click to show internal directories.
Click to hide internal directories.