Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMiddleware ¶
NewMiddleware creates a new file Middleware.
func RegisterHandlers ¶
Types ¶
type Repository ¶
type Repository interface { // Get returns the file behavior with the specified behavior scan ID. Get(ctx context.Context, id string, fields []string) (entity.Behavior, error) // Count returns the number of behavior scans. Count(ctx context.Context) (int, error) // Exists return true when the behavior scan ID exists in the DB. Exists(ctx context.Context, id string) (bool, error) // Query returns the list of file behavior scans with the given offset and limit. Query(ctx context.Context, offset, limit int) ([]entity.Behavior, error) CountAPIs(ctx context.Context, id string) (int, error) CountEvents(ctx context.Context, id string) (int, error) CountArtifacts(ctx context.Context, id string) (int, error) APIs(ctx context.Context, id string, offset, limit int) ( interface{}, error) Events(ctx context.Context, id string, offset, limit int) ( interface{}, error) Artifacts(ctx context.Context, id string, offset, limit int) (interface{}, error) }
Repository encapsulates the logic to access behavior scans from the data source.
func NewRepository ¶
func NewRepository(db *dbcontext.DB, logger log.Logger) Repository
NewRepository creates a new behavior repository.
type Service ¶
type Service interface { Get(ctx context.Context, id string, fields []string) (Behavior, error) Exists(ctx context.Context, id string) (bool, error) Count(ctx context.Context) (int, error) CountAPIs(ctx context.Context, id string) (int, error) CountArtifacts(ctx context.Context, id string) (int, error) CountEvents(ctx context.Context, id string) (int, error) Artifacts(ctx context.Context, id string, offset, limit int) (interface{}, error) APIs(ctx context.Context, id string, offset, limit int) (interface{}, error) Events(ctx context.Context, id string, offset, limit int) (interface{}, error) }
Service encapsulates usecase logic for behaviors.
func NewService ¶
func NewService(repo Repository, logger log.Logger) Service
NewService creates a new user service.
Click to show internal directories.
Click to hide internal directories.