Documentation ¶
Index ¶
- Constants
- func Init(...)
- func LikeParam(like string) string
- type Actor
- type Event
- type Image
- type ImageAccess
- type Namespace
- type NamespaceEmail
- type Notification
- type Registry
- func (registry *Registry) ApiRegister(router *gin.Engine, middlewares ...gin.HandlerFunc)
- func (registry *Registry) DeleteManifests(ctx *gin.Context)
- func (registry *Registry) FilterAccess(username string, authenticated bool, a *token.ResourceActions)
- func (registry *Registry) GenTokenForUI(username, service, scope string) (string, error)
- func (registry *Registry) GetManifests(ctx *gin.Context)
- func (registry *Registry) GetPermission(username, namespace, image string) string
- func (registry *Registry) HandleNotification(n Event)
- func (registry *Registry) ImagePublicity(ctx *gin.Context)
- func (registry *Registry) LogImageAccess(n Event)
- func (registry *Registry) MakeToken(privateKeyPath, username, service string, access []*token.ResourceActions) (string, error)
- func (registry *Registry) MineRepositories(ctx *gin.Context)
- func (registry *Registry) Namespace(ctx *gin.Context)
- func (registry *Registry) Notifications(ctx *gin.Context)
- func (registry *Registry) ParseResourceActions(scope string) []*token.ResourceActions
- func (registry *Registry) PublicRepositories(ctx *gin.Context)
- func (registry *Registry) RegistryAPI(method, path, username, acceptHeader string) ([]byte, string, error)
- func (registry *Registry) RegistryAPIDelete(path, username string) ([]byte, string, error)
- func (registry *Registry) RegistryAPIDeleteSchemaV2(path, username string) ([]byte, string, error)
- func (registry *Registry) RegistryAPIGet(path, username string) ([]byte, string, error)
- func (registry *Registry) RegistryAPIGetSchemaV1(path, username string) ([]byte, string, error)
- func (registry *Registry) RegistryAPIGetSchemaV2(path, username string) ([]byte, string, error)
- func (registry *Registry) RegistryAPIHeadSchemaV2(path, username string) ([]byte, string, error)
- func (registry *Registry) RegistryNamespaceForAccount(a auth.Account) string
- func (registry *Registry) SizeAndReferenceForTag(url string, account string) (uint64, string, error)
- func (registry *Registry) TagList(ctx *gin.Context)
- func (registry *Registry) Token(ctx *gin.Context)
- type Request
- type Tag
- type Target
- type V2RegistryResponse
- type V2RegistryResponseConfig
- type V2RegistryResponseLayer
- type V2RegistryResponseLayers
Constants ¶
View Source
const ( //Registry CodeRegistryGetManifestError = "503-14001" CodeRegistryManifestParseError = "503-14002" CodeRegistryManifestDeleteError = "503-14003" CodeRegistryImagePublicityParamError = "503-14004" CodeRegistryImagePublicityUpdateError = "503-14005" CodeRegistryCatalogListError = "503-14006" CodeRegistryTagsListError = "503-14007" CodeRegistryGetBasicAuthFailed = "400-14008" CodeRegistryMakeTokenFailed = "503-14010" CodeNamespaceParamError = "406-14011" CodeNamespaceMisMatchedPatternError = "406-14012" CodeSaveNamespaceError = "409-14013" CodeGetNamespaceError = "400-14014" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Event ¶
type Event struct { ID string `json:"Id"` TimeStamp time.Time Action string Target *Target Request *Request Actor *Actor }
Event holds the details of a event.
type Image ¶
type Image struct { ID uint64 CreatedAt time.Time UpdatedAt time.Time LatestTag string `json:"LatestTag"` Namespace string `json:"Namespace" gorm:"not null"` Image string `json:"Image" gorm:"not null"` Publicity uint8 `json:"Publicity" gorm:"not null default 0"` PushCount int64 `json:"PushCount" gorm:"-"` PullCount int64 `json:"PullCount" gorm:"-"` }
type ImageAccess ¶
type NamespaceEmail ¶ added in v1.0.6
type Registry ¶
type Registry struct { DbClient *gorm.DB Authenticator auth.Authenticator AccountAuthenticator string PrivateKeyPath string RegistryAddr string }
func NewRegistry ¶
func (*Registry) ApiRegister ¶
func (registry *Registry) ApiRegister(router *gin.Engine, middlewares ...gin.HandlerFunc)
func (*Registry) DeleteManifests ¶
func (*Registry) FilterAccess ¶
func (registry *Registry) FilterAccess(username string, authenticated bool, a *token.ResourceActions)
FilterAccess modify the action list in access based on permission determine if the request needs to be authenticated.
func (*Registry) GenTokenForUI ¶
func (*Registry) GetManifests ¶
func (*Registry) GetPermission ¶
func (*Registry) HandleNotification ¶
func (*Registry) ImagePublicity ¶
func (*Registry) LogImageAccess ¶
func (*Registry) MineRepositories ¶
func (*Registry) Notifications ¶
func (*Registry) ParseResourceActions ¶
func (registry *Registry) ParseResourceActions(scope string) []*token.ResourceActions
GetResourceActions ...
func (*Registry) PublicRepositories ¶
func (*Registry) RegistryAPI ¶
func (registry *Registry) RegistryAPI(method, path, username, acceptHeader string) ([]byte, string, error)
the following code borrowed from vmvare/Harbor project
func (*Registry) RegistryAPIDelete ¶
func (*Registry) RegistryAPIDeleteSchemaV2 ¶
func (*Registry) RegistryAPIGet ¶
func (*Registry) RegistryAPIGetSchemaV1 ¶
func (*Registry) RegistryAPIGetSchemaV2 ¶
func (*Registry) RegistryAPIHeadSchemaV2 ¶
func (*Registry) RegistryNamespaceForAccount ¶ added in v1.0.6
func (*Registry) SizeAndReferenceForTag ¶
type Tag ¶
type Tag struct { ID uint64 CreatedAt time.Time UpdatedAt time.Time Digest string `json:"Digest"` Tag string `json:"Tag"` Namespace string `json:"Namespace" gorm:"not null"` Image string `json:"Image" gorm:"not null"` Size uint64 `json:"Size"` PushCount int64 `json:"PushCount" gorm:"-"` PullCount int64 `json:"PullCount" gorm:"-"` }
type V2RegistryResponse ¶
type V2RegistryResponse struct { SchemaVersion int `json:"schemaVersion"` MediaType string `json:"mediaType"` Config V2RegistryResponseConfig `json:"config"` Layers V2RegistryResponseLayers `json:"layers"` }
type V2RegistryResponseLayer ¶
type V2RegistryResponseLayers ¶
type V2RegistryResponseLayers []V2RegistryResponseLayer
Click to show internal directories.
Click to hide internal directories.