server

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Image

type Image struct {
	Raw  []byte
	Name string
	UUID uuid.UUID
}

Image is the server representation of an image.

type Server

type Server struct {
	Store  Store
	Logger zap.Logger
}

Server implements the HTTP server.

func (*Server) Image

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

func (*Server) Upload

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

type Store

type Store interface {
	Add(ctx context.Context, m Image) error
	Get(ctx context.Context, id uuid.UUID) (Image, error)
	Search(ctx context.Context, name string) ([]Image, error)
	List(ctx context.Context, pageSize, pageNumber int) ([]Image, error)
}

Store is used to store images.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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