api

package
v0.0.0-...-e0658cb Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Artifact

type Artifact struct {
	ContentType     string            `json:"contentType"`
	ContentEncoding string            `json:"contentEncoding,omitempty"`
	Digest          string            `json:"digest"`
	Size            int64             `json:"size"`
	Annotations     map[string]string `json:"annotations,omitempty"`
	Links           ArtifactLinks     `json:"_links"`
}

type ArtifactEmbedded

type ArtifactEmbedded struct {
	Artifacts []Artifact `json:"larch:artifact"`
}
type ArtifactLinks struct {
	Curies   []Link `json:"curies"`
	Self     Link   `json:"self"`
	Snapshot Link   `json:"larch:snapshot"`
	Origin   Link   `json:"larch:origin"`
	Blob     Link   `json:"larch:blob"`
}

type ArtifactPageEmbedded

type ArtifactPageEmbedded struct {
	Artifacts []Artifact `json:"larch:artifact"`
}

type Client

type Client struct {
	Endpoint string
}

func (*Client) CopyBlob

func (c *Client) CopyBlob(ctx context.Context, w http.ResponseWriter, digest string) error

func (*Client) GetSnapshot

func (c *Client) GetSnapshot(ctx context.Context, origin string, snapshot string) (*Snapshot, error)

func (*Client) GetSnapshots

func (c *Client) GetSnapshots(ctx context.Context) (*Page[SnapshotPageEmbedded], error)
type Link struct {
	Href      string `json:"href"`
	Name      string `json:"name,omitempty"`
	Templated bool   `json:"templated,omitempty"`
}

type Page

type Page[T any] struct {
	Page     int       `json:"page"`
	Size     int       `json:"size"`
	Count    int       `json:"count"`
	Total    int       `json:"total"`
	Embedded T         `json:"_embedded"`
	Links    PageLinks `json:"_links"`
}
type PageLinks struct {
	Curies   []Link `json:"curies"`
	Self     Link   `json:"self"`
	First    Link   `json:"first"`
	Previous Link   `json:"prev,omitzero"`
	Next     Link   `json:"next,omitzero"`
	Last     Link   `json:"last"`
	Page     Link   `json:"page"`
}

type Server

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

func NewServer

func NewServer(index indexers.Indexer, libraryReaders map[string]libraries.LibraryReader) *Server

func (*Server) ServeHTTP

func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)

type Snapshot

type Snapshot struct {
	ID       string           `json:"id"`
	URL      string           `json:"url"`
	Title    string           `json:"title"`
	Origin   string           `json:"origin"`
	Date     time.Time        `json:"date"`
	Embedded SnapshotEmbedded `json:"_embedded"`
	Links    SnapshotLinks    `json:"_links"`
}

type SnapshotEmbedded

type SnapshotEmbedded struct {
	Artifacts []Artifact `json:"larch:artifact"`
}
type SnapshotLinks struct {
	Curies    []Link `json:"curies"`
	Self      Link   `json:"self"`
	Origin    Link   `json:"larch:origin"`
	Artifacts Link   `json:"larch:artifacts"`
}

type SnapshotPageEmbedded

type SnapshotPageEmbedded struct {
	Snapshots []Snapshot `json:"larch:snapshot"`
}

Jump to

Keyboard shortcuts

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