webapi

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: May 13, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ListUsers

func ListUsers(authToken string) ([]entity.User, error)

ListUsers returns the list of users.

func ListUsersWithIndex

func ListUsersWithIndex(authToken string, page, perPage int) ([]entity.User, error)

ListUsers returns the list of users given a page and a per-page data.

Types

type Pages

type Pages struct {
	Page       int `json:"page"`
	PerPage    int `json:"per_page"`
	PageCount  int `json:"page_count"`
	TotalCount int `json:"total_count"`
	Items      any `json:"items"`
}

Pages represents a paginated list of data items.

type Service

type Service struct {
	// contains filtered or unexported fields
}

func New

func New(baseURL string) Service

New generates new web apis service object.

func (Service) Delete

func (s Service) Delete(sha256, authToken string) error

func (Service) Download

func (s Service) Download(sha256, authToken string) (*bytes.Buffer, error)

func (Service) FileExists

func (s Service) FileExists(sha256 string) (bool, error)

FileExists determines file existence. TODO: use HEAD instead.

func (Service) GetFile

func (s Service) GetFile(sha256 string, file *entity.File) error

GetFile retrieves the file report given a sha256.

func (Service) GetFileStatus

func (s Service) GetFileStatus(sha256 string) (int, error)

GetFileStatus retrieves only the status field of a file.

func (Service) ListFiles

func (s Service) ListFiles(authToken string, page int) (*Pages, error)

ListFiles list all the files in DB.

func (Service) Rescan

func (s Service) Rescan(sha256, authToken, preferredOS string, enableDetonation bool, timeout int) error

func (Service) Scan

func (s Service) Scan(filepath string, authToken, preferredOS string, enableDetonation bool, timeout int) (*entity.File, error)

Jump to

Keyboard shortcuts

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