api

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultLimit is the default pagination limit
	DefaultLimit = 10
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

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

The Controller implements the API endpoints

func NewController

func NewController(index *index.Index, listen string, CORSAllowAll bool) *Controller

NewController creates a new Controller instance fully ready to serve

func (*Controller) Serve

func (c *Controller) Serve(ctx context.Context, wg *sync.WaitGroup)

Serve starts the controller as a background process until the context is cancelled

type ListRepositoriesResponse

type ListRepositoriesResponse struct {
	Repositories []RepositoryStatus `json:"repositories"`
}

ListRepositoriesResponse contains the response from listing all repositories

type RepositoryStatus

type RepositoryStatus struct {
	Name   string `json:"name"`
	Images int    `json:"images"`
}

RepositoryStatus contains the status of a single repository

type SearchQuery

type SearchQuery struct {
	Labels        map[string]string `json:"labels"`
	CreatedAfter  time.Time         `json:"created_after"`
	CreatedBefore time.Time         `json:"created_before"`
}

SearchQuery contains the parameters for an image search

type SearchResponse

type SearchResponse struct {
	Repository string         `json:"name"`
	Images     []*index.Image `json:"images"`
	Offset     int            `json:"offset"`
	Limit      int            `json:"limit"`
	Count      int            `json:"count"`
}

SearchResponse contrainer the result of an image search

Jump to

Keyboard shortcuts

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