Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrHostNotFound = errors.New("host not found")
Functions ¶
func WithBaseHostname ¶
func WithBaseHostname(baseHostname string) serviceOption
WithBaseHostname provides a base hostname, to use when generating hostnames.
func WithDatabase ¶
func WithDatabase(db Database) serviceOption
WithDatabase provides a database, which is used for storing hosts data.
func WithLogger ¶
WithLogger provides a logger, which is used for logging hosts management events.
Types ¶
type Database ¶
type Database interface { StoreHosts(ctx context.Context, hosts ...Host) error StoreHTTPLogEntry(ctx context.Context, entry HTTPLogEntry) error FindHostByID(ctx context.Context, hostID ulid.ULID) (Host, error) FindHostByHostname(ctx context.Context, hostname string) (Host, error) ListHTTPLogEntries(ctx context.Context, params ListHTTPLogEntriesParams) ([]HTTPLogEntry, error) }
type HTTPLogEntry ¶
type Service ¶
type Service interface { CreateHosts(ctx context.Context, amount int) ([]Host, error) FindHostByID(ctx context.Context, hostID ulid.ULID) (Host, error) StoreHTTPLogEntry(ctx context.Context, params StoreHTTPLogEntryParams) error ListHTTPLogEntries(ctx context.Context, params ListHTTPLogEntriesParams) ([]HTTPLogEntry, error) }
func NewService ¶
func NewService(opts ...serviceOption) Service
Click to show internal directories.
Click to hide internal directories.