domain

package
v1.6.2 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: MIT Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewService

func NewService(repository Repository, client client.Client, config core.Config) core.DomainService

NewService creates a new host service

Types

type Handler

type Handler interface {
	Get(c echo.Context) error
	List(c echo.Context) error
}

Service is the domain service interface

func NewHandler

func NewHandler(service core.DomainService) Handler

NewHandler creates a new handler

type Repository

type Repository interface {
	GetByFQDN(ctx context.Context, key string) (core.Domain, error)
	GetByCCID(ctx context.Context, ccid string) (core.Domain, error)
	GetByCSID(ctx context.Context, ccid string) (core.Domain, error)
	Upsert(ctx context.Context, host core.Domain) (core.Domain, error)
	GetList(ctx context.Context) ([]core.Domain, error)
	Delete(ctx context.Context, id string) error
	UpdateScrapeTime(ctx context.Context, id string, scrapeTime time.Time) error
	Update(ctx context.Context, host core.Domain) error
}

Repository is the interface for host repository

func NewRepository

func NewRepository(db *gorm.DB) Repository

NewRepository creates a new host repository

Jump to

Keyboard shortcuts

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