utils

package
v1.13.15 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2022 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetK8sClient

func GetK8sClient() (client.Client, error)

func IsDeployReady added in v1.3.0

func IsDeployReady(ctx context.Context, c client.Client, name, namespace string) wait.ConditionFunc

IsPodReady check if the pod in question is running state

func IsPodReady added in v1.3.0

func IsPodReady(ctx context.Context, c client.Client, podName, namespace string) wait.ConditionFunc

IsPodReady check if the pod in question is running state

func IsPodRunning added in v1.3.0

func IsPodRunning(ctx context.Context, c client.Client, podName, namespace string) wait.ConditionFunc

IsPodRunning check if the pod in question is running state

func IsUptodate added in v1.3.2

func IsUptodate(latest, current string) bool

func NewSpinner added in v1.2.4

func NewSpinner(text string) *pterm.SpinnerPrinter

NewSpinner ...

func WaitAPIServiceReady added in v1.3.0

func WaitAPIServiceReady(ctx context.Context, client client.Client) error

func WaitForDeploymentReady added in v1.3.0

func WaitForDeploymentReady(ctx context.Context, k8sClient client.Client, namespace string, name string, timeout time.Duration) error

func WaitForPodsReady added in v1.3.0

func WaitForPodsReady(ctx context.Context, k8sClient client.Client, namespace string, name string, timeout time.Duration, bylabel string) error

Types

type ErrorResponse added in v1.2.4

type ErrorResponse struct {
	StatusCode int
	Errors     string
}

type GithubClient added in v1.2.4

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

func NewGithubClient added in v1.2.4

func NewGithubClient(apiKey string, httpClient *http.Client) (*GithubClient, error)

func (*GithubClient) Do added in v1.2.4

func (c *GithubClient) Do(req *http.Request, v interface{}) (*ErrorResponse, error)

func (*GithubClient) DoRequest added in v1.2.4

func (c *GithubClient) DoRequest(method, path string, body, v interface{}) (*ErrorResponse, error)

func (*GithubClient) GetLatest added in v1.3.0

func (c *GithubClient) GetLatest(repo string) (string, error)

func (*GithubClient) GetTags added in v1.2.4

func (c *GithubClient) GetTags(repo string) (*Latest, *ErrorResponse, error)

func (*GithubClient) NewRequest added in v1.2.4

func (c *GithubClient) NewRequest(method, path string, body interface{}) (*http.Request, error)

type Latest added in v1.3.2

type Latest struct {
	URL       string `json:"url"`
	AssetsURL string `json:"assets_url"`
	UploadURL string `json:"upload_url"`
	HTMLURL   string `json:"html_url"`
	ID        int    `json:"id"`
	Author    struct {
		Login             string `json:"login"`
		ID                int    `json:"id"`
		NodeID            string `json:"node_id"`
		AvatarURL         string `json:"avatar_url"`
		GravatarID        string `json:"gravatar_id"`
		URL               string `json:"url"`
		HTMLURL           string `json:"html_url"`
		FollowersURL      string `json:"followers_url"`
		FollowingURL      string `json:"following_url"`
		GistsURL          string `json:"gists_url"`
		StarredURL        string `json:"starred_url"`
		SubscriptionsURL  string `json:"subscriptions_url"`
		OrganizationsURL  string `json:"organizations_url"`
		ReposURL          string `json:"repos_url"`
		EventsURL         string `json:"events_url"`
		ReceivedEventsURL string `json:"received_events_url"`
		Type              string `json:"type"`
		SiteAdmin         bool   `json:"site_admin"`
	} `json:"author"`
	NodeID          string    `json:"node_id"`
	TagName         string    `json:"tag_name"`
	TargetCommitish string    `json:"target_commitish"`
	Name            string    `json:"name"`
	Draft           bool      `json:"draft"`
	Prerelease      bool      `json:"prerelease"`
	CreatedAt       time.Time `json:"created_at"`
	PublishedAt     time.Time `json:"published_at"`
	Assets          []struct {
		URL      string `json:"url"`
		ID       int    `json:"id"`
		NodeID   string `json:"node_id"`
		Name     string `json:"name"`
		Label    string `json:"label"`
		Uploader struct {
			Login             string `json:"login"`
			ID                int    `json:"id"`
			NodeID            string `json:"node_id"`
			AvatarURL         string `json:"avatar_url"`
			GravatarID        string `json:"gravatar_id"`
			URL               string `json:"url"`
			HTMLURL           string `json:"html_url"`
			FollowersURL      string `json:"followers_url"`
			FollowingURL      string `json:"following_url"`
			GistsURL          string `json:"gists_url"`
			StarredURL        string `json:"starred_url"`
			SubscriptionsURL  string `json:"subscriptions_url"`
			OrganizationsURL  string `json:"organizations_url"`
			ReposURL          string `json:"repos_url"`
			EventsURL         string `json:"events_url"`
			ReceivedEventsURL string `json:"received_events_url"`
			Type              string `json:"type"`
			SiteAdmin         bool   `json:"site_admin"`
		} `json:"uploader"`
		ContentType        string    `json:"content_type"`
		State              string    `json:"state"`
		Size               int       `json:"size"`
		DownloadCount      int       `json:"download_count"`
		CreatedAt          time.Time `json:"created_at"`
		UpdatedAt          time.Time `json:"updated_at"`
		BrowserDownloadURL string    `json:"browser_download_url"`
	} `json:"assets"`
	TarballURL    string `json:"tarball_url"`
	ZipballURL    string `json:"zipball_url"`
	Body          string `json:"body"`
	DiscussionURL string `json:"discussion_url"`
}

type Obj added in v1.2.4

type Obj struct {
	SHA   string `json:"sha,omitempty"`
	TType string `json:"type,omitempty"`
	URL   string `json:"url,omitempty"`
}

type Tag added in v1.2.4

type Tag struct {
	Ref    string `json:"ref,omitempty"`
	NodeID string `json:"node_id,omitempty"`
	URL    string `json:"url,omitempty"`
	Object Obj    `json:"object,omitempty"`
}

https://api.github.com/repos/kubeshop/kusk-gateway/releases/latest

Jump to

Keyboard shortcuts

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