utils

package
Version: v0.0.0-...-171028a Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2016 License: Apache-2.0, BSD-3-Clause, CC-BY-3.0, MIT, MPL-2.0, Zlib Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Cache cache.Cache

Cache is the global cache in system.

Functions

func BuildRegistryURL

func BuildRegistryURL(segments ...string) string

BuildRegistryURL ...

func FilterAccess

func 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 GenTokenForUI

func GenTokenForUI(username, service, scope string) (string, error)

GenTokenForUI is for the UI process to call, so it won't establish a https connection from UI to proxy.

func GetRepoFromCache

func GetRepoFromCache() ([]string, error)

GetRepoFromCache get repository list from cache, it refreshes the cache if it's empty.

func GetResourceActions

func GetResourceActions(scope string) []*token.ResourceActions

GetResourceActions ...

func MakeToken

func MakeToken(username, service string, access []*token.ResourceActions) (string, error)

MakeToken makes a valid jwt token based on parms.

func RefreshCatalogCache

func RefreshCatalogCache() error

RefreshCatalogCache calls registry's API to get repository list and write it to cache.

func RegistryAPIGet

func RegistryAPIGet(url, username string) ([]byte, error)

RegistryAPIGet triggers GET request to the URL which is the endpoint of registry and returns the response body. It will attach a valid jwt token to the request if registry requires.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL