utils

package
v1.2.0-beta.2 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2021 License: Apache-2.0 Imports: 8 Imported by: 8

Documentation

Index

Constants

View Source
const TypeGithub = "github"

TypeGithub represents github

View Source
const TypeLocal = "local"

TypeLocal represents github

View Source
const TypeOss = "oss"

TypeOss represent oss

View Source
const TypeUnknown = "unknown"

TypeUnknown represents parse failed

Variables

This section is empty.

Functions

func DumpJSON

func DumpJSON(o interface{}) string

DumpJSON returns the JSON encoding

func ParseAPIServerEndpoint added in v1.1.9

func ParseAPIServerEndpoint(server string) (string, error)

ParseAPIServerEndpoint automatically construct the full url of APIServer It will patch port and scheme if not exists

func RandomString added in v1.1.1

func RandomString(n int) string

RandomString generate random string.

Types

type Content added in v1.2.0

type Content struct {
	OssContent
	GithubContent
	LocalContent
}

Content contains different type of content needed when building Registry

func Parse added in v1.2.0

func Parse(addr string) (string, *Content, error)

Parse will parse config from address

type GithubContent added in v1.2.0

type GithubContent struct {
	Owner string `json:"owner"`
	Repo  string `json:"repo"`
	Path  string `json:"path"`
	Ref   string `json:"ref"`
}

GithubContent for cap center

type LocalContent added in v1.2.0

type LocalContent struct {
	AbsDir string `json:"abs_dir"`
}

LocalContent for local registry

type OssContent added in v1.2.0

type OssContent struct {
	EndPoint string `json:"bucket_url"`
	Bucket   string `json:"bucket"`
}

OssContent for oss registry

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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