common

package
v0.0.18 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

View Source
const (
	DEFAULT_REGISTRY = "index.docker.io"
	DEFAULT_TAG      = "latest"
)

Variables

This section is empty.

Functions

func MakeRepoWithRegistry

func MakeRepoWithRegistry(repoName string, registry *name.Registry) (*name.Repository, error)

func ValidateAuth

func ValidateAuth(auth *authn.AuthConfig) error

Types

type CatalogOption

type CatalogOption struct {
	IncludeLastModified bool
	IsPublic            bool
	Namespaces          string //scope for e.g cataloging just "armosec" images
}

type PaginationOption

type PaginationOption struct {
	Cursor string
	Size   int
}

func CalcNextV2Pagination

func CalcNextV2Pagination(repos []string, size int) *PaginationOption

TODO - get pagination info for request header instead of guessing next page existence by size

func GetNextV2Pagination

func GetNextV2Pagination(resp *http.Response) (*PaginationOption, error)

GetNextV2Pagination from response header

func MakePagination

func MakePagination(size int) PaginationOption

func NoPaginationOption

func NoPaginationOption() PaginationOption

type RegistryKind

type RegistryKind string
const (
	Generic RegistryKind = ""
	Harbor  RegistryKind = "harbor"
	Quay    RegistryKind = "quay.io"
)

func GetRegistryKind

func GetRegistryKind(kindStr string) (RegistryKind, error)

type RegistryOptions

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

func MakeRegistryOptions

func MakeRegistryOptions(isStrict, isInsecure, skipTLSVerify bool, defaultRegistry, defaultTag, project string, kind RegistryKind) *RegistryOptions

func (*RegistryOptions) DefaultRegistry

func (r *RegistryOptions) DefaultRegistry() string

func (*RegistryOptions) DefaultTag

func (r *RegistryOptions) DefaultTag() string

func (*RegistryOptions) Insecure

func (r *RegistryOptions) Insecure() bool

func (*RegistryOptions) Kind

func (r *RegistryOptions) Kind() RegistryKind

func (*RegistryOptions) Project

func (r *RegistryOptions) Project() string

func (*RegistryOptions) SkipTLSVerify

func (r *RegistryOptions) SkipTLSVerify() bool

func (*RegistryOptions) Strict

func (r *RegistryOptions) Strict() bool

type V2TokenResponse

type V2TokenResponse struct {
	Token string `json:"token"`
}

Jump to

Keyboard shortcuts

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