config

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package config contains data types for configuration of olareg.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	HTTP    ConfigHTTP
	Storage ConfigStorage
	API     ConfigAPI
	Log     slog.Logger
}

func (*Config) SetDefaults

func (c *Config) SetDefaults()

type ConfigAPI

type ConfigAPI struct {
	PushEnabled   *bool
	DeleteEnabled *bool
	Manifest      ConfigAPIManifest
	Blob          ConfigAPIBlob
	Referrer      ConfigAPIReferrer
}

type ConfigAPIBlob

type ConfigAPIBlob struct {
	DeleteEnabled *bool
}

type ConfigAPIManifest

type ConfigAPIManifest struct {
	Limit int64
}

type ConfigAPIReferrer

type ConfigAPIReferrer struct {
	Enabled         *bool
	PageCacheExpire time.Duration // time to save pages for a paged response
	PageCacheLimit  int           // max number of paged responses to keep in memory
	Limit           int64         // max size of a referrers response (OCI recommends 4MiB)
}

type ConfigGC

type ConfigGC struct {
	Frequency         time.Duration // frequency to run garbage collection, disable gc with a negative value
	GracePeriod       time.Duration // time to preserve recently pushed manifests and blobs, disable with a negative value
	Untagged          *bool         // delete untagged manifests
	EmptyRepo         *bool         // delete empty repo
	ReferrersDangling *bool         // delete referrers when manifest does not exist
	ReferrersWithSubj *bool         // delete referrers response when subject manifest is deleted
}

type ConfigHTTP

type ConfigHTTP struct {
	Addr     string // address and port to listen on, e.g. ":5000"
	CertFile string // public certificate for https server (leave blank for http)
	KeyFile  string // private key for https server (leave blank for http)
}

type ConfigStorage

type ConfigStorage struct {
	StoreType Store
	RootDir   string   // root directory for filesystem backed storage
	ReadOnly  *bool    // read only disables all writes to the backing filesystem
	GC        ConfigGC // garbage collection policy
}

type Store

type Store int
const (
	StoreUndef  Store = iota // undefined backend storage is the invalid zero value
	StoreMem                 // StoreMem only uses memory for an ephemeral registry
	StoreDir                 // StoreDir tracks each repository with a separate blob store
	StoreShared              // StoreShared tracks the blobs in a single store for less disk usage
)

func (Store) MarshalText

func (s Store) MarshalText() ([]byte, error)

func (*Store) UnmarshalText

func (s *Store) UnmarshalText(b []byte) error

Jump to

Keyboard shortcuts

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