Documentation
¶
Index ¶
- Constants
- type AccessLogEntry
- type Action
- type Artifact
- type ArtifactRepository
- type ArtifactSearchCriteria
- type ArtifactSettings
- type AuthConfig
- type AuthSettings
- type BlobMetrics
- type CleanupPolicy
- type Config
- type CustomClaims
- type DiskInfo
- type DockerManifest
- type GlobalView
- type Group
- type ImageMetadata
- type ImageRepository
- type ImageTag
- type MetricsData
- type PerformanceMetrics
- type Permission
- type PropertiesConfig
- type ProxyConfig
- type PwPolicy
- type RegistrySettings
- type RegistryStats
- type Resource
- type ResourceActions
- type RetentionPolicy
- type Role
- type Scope
- type SearchConfig
- type SearchResponse
- type Settings
- type StorageConfig
- type TimeSeriesPoint
- type User
- type VisibilityUpdateRequest
- type VisibilityUpdateResponse
Constants ¶
View Source
const ( // ACTIONS ActionView Action = "VIEW" ActionCreate Action = "CREATE" ActionUpdate Action = "UPDATE" ActionDelete Action = "DELETE" ActionPush Action = "PUSH" ActionPull Action = "PULL" ActionAdmin Action = "ADMIN" ActionLogin Action = "LOGIN" ActionLogout Action = "LOGOUT" ActionMigrate Action = "MIGRATE" ActionUpload Action = "UPLOAD" ActionDownload Action = "DOWNLOAD" // RESOURCES ResourceTask Resource = "TASK" ResourceWebUI Resource = "WEBUI" ResourceImage Resource = "IMAGE" ResourceTag Resource = "TAG" ResourceUser Resource = "USER" ResourceGroup Resource = "GROUP" ResourceSystem Resource = "SYSTEM" ResourceArtifact Resource = "ARTIFACT" ResourceRepo Resource = "REPO" // SCOPES ScopeGlobal Scope = "global" ScopeRepository Scope = "repository" ScopeProject Scope = "project" )
PERMISSIONS - SINGLE SOURCE OF TRUTH
View Source
const ( SettingKeyArtifacts = "artifacts" SettingKeyRegistry = "registry" SettingKeyAuth = "auth" )
SETTINGS KEYS
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccessLogEntry ¶
type Artifact ¶
type Artifact struct {
ID string `json:"id"`
RepoID int `json:"repo_id"`
Name string `json:"name"`
Path string `json:"path"`
UploadID string `json:"upload_id"`
Version string `json:"version"`
Size int64 `json:"size"`
MimeType string `json:"mime_type"`
Metadata string `json:"metadata"`
Properties map[string]string `json:"properties"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
type ArtifactRepository ¶
type ArtifactSearchCriteria ¶
type ArtifactSearchCriteria struct {
RepoID *int `json:"repo_id,omitempty"`
Username string `json:"username,omitempty"`
Name *string `json:"name,omitempty"`
Version *string `json:"version,omitempty"`
Path *string `json:"path,omitempty"`
Properties map[string]string `json:"properties,omitempty"`
Sort string `json:"sort,omitempty"`
Order string `json:"order,omitempty"`
Limit int `json:"limit,omitempty"`
Offset int `json:"offset,omitempty"`
}
type ArtifactSettings ¶
type ArtifactSettings struct {
Retention RetentionPolicy `json:"retention"`
Storage StorageConfig `json:"storage"`
Properties PropertiesConfig `json:"properties"`
Search SearchConfig `json:"search"`
}
ARTIFACT SETTINGS
func (*ArtifactSettings) GetDefaults ¶
func (s *ArtifactSettings) GetDefaults() Settings
func (*ArtifactSettings) IsStartupOnly ¶
func (s *ArtifactSettings) IsStartupOnly() bool
func (*ArtifactSettings) Section ¶
func (s *ArtifactSettings) Section() string
func (*ArtifactSettings) Validate ¶
func (s *ArtifactSettings) Validate() error
type AuthConfig ¶
type AuthSettings ¶
type AuthSettings struct {
TokenExpiry int `json:"tokenExpiry"`
SessionTimeout int `json:"sessionTimeout"`
PasswordPolicy PwPolicy `json:"passwordPolicy"`
AllowAnonymous bool `json:"allowAnonymous"`
}
AUTH SETTINGS
func (*AuthSettings) GetDefaults ¶
func (s *AuthSettings) GetDefaults() Settings
func (*AuthSettings) IsStartupOnly ¶
func (s *AuthSettings) IsStartupOnly() bool
func (*AuthSettings) Section ¶
func (s *AuthSettings) Section() string
func (*AuthSettings) Validate ¶
func (s *AuthSettings) Validate() error
type BlobMetrics ¶
type BlobMetrics struct {
Total int64 `json:"total"`
Failed int64 `json:"failed"`
InProgress int32 `json:"inProgress"`
BytesProcessed int64 `json:"bytesProcessed"`
AvgDuration float64 `json:"avgDuration"`
}
METRIC TYPES
type CleanupPolicy ¶
type Config ¶
type Config struct {
Server struct {
Port string `json:"port" yaml:"port"`
Domain string `json:"domain" yaml:"domain"`
RSAKeyFile string `json:"rsaKeyFile" yaml:"rsa_key_file"`
TLSKeyFile string `json:"tlsKeyFile" yaml:"tls_key_file"`
TLSCertFile string `json:"tlsCertFile" yaml:"tls_certificate"`
CertBundle string `json:"certBundle" yaml:"cert_bundle"`
} `json:"server" yaml:"server"`
Storage struct {
RootDirectory string `json:"rootDirectory" yaml:"root_directory"`
} `json:"storage" yaml:"storage"`
Database struct {
Path string `json:"path" yaml:"path"`
} `json:"database" yaml:"database"`
Auth struct {
Realm string `json:"realm" yaml:"realm"`
Service string `json:"service" yaml:"service"`
Issuer string `json:"issuer" yaml:"issuer"`
} `json:"auth" yaml:"auth"`
Init struct {
Drop bool `json:"drop" yaml:"drop"`
Roles bool `json:"roles" yaml:"roles"`
Groups bool `json:"groups" yaml:"groups"`
User bool `json:"user" yaml:"user"`
Username string `json:"username" yaml:"username"`
Password string `json:"password" yaml:"password"`
Migrations bool `json:"migrations" yaml:"migrations"`
} `json:"init" yaml:"init"`
}
type CustomClaims ¶
type CustomClaims struct {
Subject string `json:"sub,omitempty"`
Access []*ResourceActions `json:"access,omitempty"`
Groups []string `json:"groups,omitempty"`
jwt.RegisteredClaims
}
func (CustomClaims) Valid ¶
func (c CustomClaims) Valid() error
type DockerManifest ¶
type DockerManifest struct {
SchemaVersion int `json:"schemaVersion"`
MediaType string `json:"mediaType"`
Config struct {
MediaType string `json:"mediaType"`
Size int64 `json:"size"`
Digest string `json:"digest"`
} `json:"config"`
Layers []struct {
MediaType string `json:"mediaType"`
Size int64 `json:"size"`
Digest string `json:"digest"`
} `json:"layers"`
}
type GlobalView ¶
type GlobalView struct {
TotalImages int64 `json:"total_images"`
TotalSize int64 `json:"total_size"`
Images []*ImageMetadata `json:"images"`
}
DEFAULT SYSTEM ROLES - TODO: USE THIS INSTEAD OF MANUAL MIGRATIONS
type Group ¶
type Group struct {
ID int `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
Roles []string `json:"roles"`
Scope Scope `json:"scope"`
Target string `json:"target,omitempty"` // OPT TARGET W/ SCOPE
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
ROLES AND USERS
type ImageMetadata ¶
type ImageMetadata struct {
ID string `json:"id"`
Name string `json:"name"`
Tags []string `json:"tags"`
Size int64 `json:"size"`
Owner string `json:"owner"`
Labels map[string]string `json:"labels"`
Private bool `json:"private"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
type ImageRepository ¶
type MetricsData ¶
type MetricsData struct {
BlobUploads BlobMetrics `json:"blobUploads"`
BlobDownloads BlobMetrics `json:"blobDownloads"`
Performance PerformanceMetrics `json:"performance"`
TimeseriesData []TimeSeriesPoint `json:"timeseriesData"`
AccessLogs []AccessLogEntry `json:"access_logs"`
}
type PerformanceMetrics ¶
type PerformanceMetrics struct {
AvgUploadSpeed float64 `json:"avgUploadSpeed"` // MB/S
AvgDownloadSpeed float64 `json:"avgDownloadSpeed"` // MB/S
DiskUsage int64 `json:"diskUsage"` // GB
DiskTotal int64 `json:"diskTotal"` // GB
MemoryUsage int64 `json:"memoryUsage"` // MB
MemoryTotal int64 `json:"memoryTotal"` // MB
CpuUsage float64 `json:"cpuUsage"`
}
type Permission ¶
type Permission struct {
Action Action `json:"action"`
Resource Resource `json:"resource"`
Scope Scope `json:"scope,omitempty"`
Target string `json:"target,omitempty"` // OPT TARGET W/ SCOPE
}
SINGLE CAPABILITY TO DO SOMETHING
func (Permission) String ¶
func (p Permission) String() string
type PropertiesConfig ¶
type ProxyConfig ¶
type RegistrySettings ¶
type RegistrySettings struct {
Cleanup CleanupPolicy `json:"cleanup"`
Proxy ProxyConfig `json:"proxy"`
Storage StorageConfig `json:"storage"`
}
REGISTRY SETTINGS
func (*RegistrySettings) GetDefaults ¶
func (s *RegistrySettings) GetDefaults() Settings
func (*RegistrySettings) IsStartupOnly ¶
func (s *RegistrySettings) IsStartupOnly() bool
func (*RegistrySettings) Section ¶
func (s *RegistrySettings) Section() string
func (*RegistrySettings) Validate ¶
func (s *RegistrySettings) Validate() error
type RegistryStats ¶
type RegistryStats struct {
TotalImages int64 `json:"total_images"`
TotalSize int64 `json:"total_size"`
Images []*ImageMetadata `json:"images"`
}
type ResourceActions ¶
type ResourceActions struct {
Type string `json:"type"`
Name string `json:"name"`
Actions []string `json:"actions"`
}
FOR UNDERLYING REGISTRY AUTH
type RetentionPolicy ¶
type Role ¶
type Role struct {
ID int `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
Permissions []Permission `json:"permissions"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
NAMED SET OF PERMISSIONS
func (*Role) MarshalPermissions ¶
PERMISSIONS TO JSON
func (*Role) UnmarshalPermissions ¶
JSON TO PERMISSIONS
type SearchConfig ¶
type SearchResponse ¶
type Settings ¶
type Settings interface {
Validate() error
GetDefaults() Settings
Section() string
IsStartupOnly() bool
}
SETTINGS INTERFACE
func GetSettingsWithDefaults ¶
GET SETTINGS WITH DEFAULTS
func NewSettings ¶
type StorageConfig ¶
type TimeSeriesPoint ¶
type User ¶
type User struct {
ID int `json:"id"`
Username string `json:"username"`
Password []byte `json:"-,omitempty"`
Groups []string `json:"groups"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
SYSTEM USER WITH GROUPS
type VisibilityUpdateRequest ¶
Click to show internal directories.
Click to hide internal directories.