serviceinterface

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

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

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.

Jump to

Keyboard shortcuts

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