multitenant

package
v0.16.1 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2023 License: Apache-2.0 Imports: 27 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	EntrySavedMessage             = "Entry saved in cache store"
	CouldNotSaveEntryErrorMessage = "Could not save entry in cache store"
)

Functions

This section is empty.

Types

type HTTPError

type HTTPError struct {
	Status  int
	Message string
}

type MultiTenantServer

type MultiTenantServer struct {
	Logger                 *cm_logger.Logger
	Router                 *cm_router.Router
	StorageBackend         cm_storage.Backend
	TimestampTolerance     time.Duration
	ExternalCacheStore     cache.Store
	InternalCacheStore     memoryCacheStore
	MaxStorageObjects      int
	IndexLimit             int
	AllowOverwrite         bool
	AllowForceOverwrite    bool
	APIEnabled             bool
	DisableDelete          bool
	UseStatefiles          bool
	ChartURL               string
	ChartPostFormFieldName string
	ProvPostFormFieldName  string
	Version                string
	Limiter                chan struct{}
	Tenants                map[string]*tenantInternals
	TenantCacheKeyLock     *sync.Mutex
	CacheInterval          time.Duration
	EventChan              chan event
	ChartLimits            *ObjectsPerChartLimit
	ArtifactHubRepoID      map[string]string
	// Deprecated: see https://github.com/helm/chartmuseum/issues/485 for more info
	EnforceSemver2        bool
	WebTemplatePath       string
	AlwaysRegenerateIndex bool
}

MultiTenantServer contains a Logger, Router, storage backend and object cache

func NewMultiTenantServer

func NewMultiTenantServer(options MultiTenantServerOptions) (*MultiTenantServer, error)

NewMultiTenantServer creates a new MultiTenantServer instance

func (*MultiTenantServer) CheckTemplateFilesExist added in v0.15.0

func (server *MultiTenantServer) CheckTemplateFilesExist(path string, logger *cm_logger.Logger) bool

func (*MultiTenantServer) Listen

func (server *MultiTenantServer) Listen(port int)

Listen starts the router on a given port

func (*MultiTenantServer) PutWithLimit added in v0.14.0

func (server *MultiTenantServer) PutWithLimit(ctx *gin.Context, log cm_logger.LoggingFn, repo string,
	filename string, content []byte,
) error

func (*MultiTenantServer) Routes

func (s *MultiTenantServer) Routes() []*cm_router.Route

type MultiTenantServerOptions

type MultiTenantServerOptions struct {
	Logger                 *cm_logger.Logger
	Router                 *cm_router.Router
	StorageBackend         cm_storage.Backend
	ExternalCacheStore     cache.Store
	TimestampTolerance     time.Duration
	ChartURL               string
	ChartPostFormFieldName string
	ProvPostFormFieldName  string
	Version                string
	MaxStorageObjects      int
	IndexLimit             int
	GenIndex               bool
	AllowOverwrite         bool
	AllowForceOverwrite    bool
	EnableAPI              bool
	DisableDelete          bool
	UseStatefiles          bool
	CacheInterval          time.Duration
	PerChartLimit          int
	ArtifactHubRepoID      map[string]string
	WebTemplatePath        string
	// Deprecated: see https://github.com/helm/chartmuseum/issues/485 for more info
	EnforceSemver2        bool
	AlwaysRegenerateIndex bool
}

MultiTenantServerOptions are options for constructing a MultiTenantServer

type ObjectsPerChartLimit added in v0.14.0

type ObjectsPerChartLimit struct {
	*sync.Mutex
	Limit int
}

type StorageObject

type StorageObject struct {
	*storage.Object
	ContentType string
}

Jump to

Keyboard shortcuts

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