server

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2026 License: MIT Imports: 32 Imported by: 0

Documentation

Overview

Package server implements the Epoch HTTP server. Uses gorilla/mux because stdlib ServeMux rejects OCI Distribution route patterns.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FinalizedUpload added in v0.1.7

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

FinalizedUpload owns the tempfile of a finalized upload. Caller must Close it.

func (*FinalizedUpload) Close added in v0.1.7

func (f *FinalizedUpload) Close() error

Close removes the underlying tempfile and releases resources.

func (*FinalizedUpload) Reader added in v0.1.7

func (f *FinalizedUpload) Reader() (io.Reader, error)

Reader returns a reader positioned at the start of the upload data.

func (*FinalizedUpload) Size added in v0.1.7

func (f *FinalizedUpload) Size() int64

Size returns the total byte count of the upload.

type SSOConfig

type SSOConfig struct {
	Provider      string
	ClientID      string
	ClientSecret  string //nolint:gosec // OAuth configuration schema field name
	RedirectURI   string
	AuthorizeURL  string
	TokenURL      string
	UserInfoURL   string
	LogoutURL     string
	Scopes        string
	HostedDomains []string // allow-list of Google Workspace domains
	CookieSecret  []byte
}

SSOConfig holds OAuth/OIDC provider settings for UI authentication.

func LoadSSOConfig

func LoadSSOConfig(ctx context.Context) *SSOConfig

LoadSSOConfig reads SSO provider settings from environment variables.

type Server

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

Server is the Epoch HTTP server providing OCI Distribution and control plane APIs.

func New

func New(ctx context.Context, reg *registry.Registry, st *store.Store, addr string) *Server

New creates a Server with routes, auth, and upload sessions configured.

func (*Server) ListenAndServe

func (s *Server) ListenAndServe(ctx context.Context) error

ListenAndServe starts the HTTP server and blocks until ctx is canceled.

Jump to

Keyboard shortcuts

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