viewhelpers

package
v0.0.29 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2020 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddFilterValue

func AddFilterValue(filter *component.TableFilter, value string)

AddFilterValue adds the filter value if its missing

func FindLatestPodForSelector

func FindLatestPodForSelector(ctx context.Context, client service.Dashboard, namespace string, selector labels.Set) (*corev1.Pod, error)

func GetResourceByName

func GetResourceByName(ctx context.Context, client service.Dashboard, apiVersion, kind, name, ns string) (*unstructured.Unstructured, error)

GetResourceByName looks up the resource by name

func InitTableFilters

func InitTableFilters(filters []*component.TableFilter)

InitTableFilters sorts the values and sets the selected values to the current values

func ListPodsBySelector

func ListPodsBySelector(ctx context.Context, client service.Dashboard, namespace string, selector labels.Set) ([]*corev1.Pod, error)

ListPodsBySelector loads the pods for the given selector

func ListResourcesBySelector

func ListResourcesBySelector(ctx context.Context, client service.Dashboard, apiVersion, kind, ns string, selector labels.Set) (*unstructured.UnstructuredList, error)

ListResourcesBySelector lists resources using a selector

func MatchesSelector

func MatchesSelector(labels map[string]string, selector labels.Set) bool

MatchesSelector returns true if the given labels match the selector

func NewMarkdownCard

func NewMarkdownCard(title, bodyText string) *component.Card

NewMarkdownCard helper function to create a card with a text body

func NewMarkdownText added in v0.0.28

func NewMarkdownText(text string) *component.Text

NewMarkdownText creates a trusted markdown object

func NewTextCard

func NewTextCard(title, bodyText string) *component.Card

NewTextCard helper function to create a card with a text body

func PipelineBuildNumber

func PipelineBuildNumber(pa *v1.PipelineActivity) int

PipelineBuildNumber returns the build number for the pipeline

func ResourceTimeLessThan

func ResourceTimeLessThan(t1, t2 *metav1.Time) bool

ResourceTimeLessThan returns whether the first time is less than the second time

func SortSummarySection

func SortSummarySection(sections []component.SummarySection)

SortSummarySection sorts the summary sections in name order

func ToApplicationIcon

func ToApplicationIcon(icon string) string

ToApplicationIcon converts the string into an icon replacing any known bad images with better ones etc

func ToBreadcrumbMarkdown

func ToBreadcrumbMarkdown(names ...string) string

ToBreadcrumbMarkdown creates a breadcrumb row

func ToDurationMarkdown

func ToDurationMarkdown(time time.Time, titlePrefix string) string

func ToDurationString

func ToDurationString(u time.Time) string

func ToGitLinkMarkdown

func ToGitLinkMarkdown(repoLink string) string
func ToMarkdownExternalLink(title, target, link string) string
func ToMarkdownLink(title, link string) string

func ToMarkdownLinkFromURL

func ToMarkdownLinkFromURL(link string) string

func ToOwnerRepositoryLinkMarkdown

func ToOwnerRepositoryLinkMarkdown(owner, repository, repoLink string) string

ToOwnerRepositoryLinkMarkdown converts the given owner/repository and link to markdown

func ToPipelineActivity

func ToPipelineActivity(u *unstructured.Unstructured) (*v1.PipelineActivity, error)

ToPipelineActivity converts to a PipelineActivity

func ToPod

ToPod converts to a Pod

func ToSecret

func ToSecret(u *unstructured.Unstructured) (*corev1.Secret, error)

ToSecret converts to a Secret

func ToStructured

func ToStructured(u *unstructured.Unstructured, structured interface{}) error

ToStructured converts an unstructured object to a pointer to a structured type

func ToTimeMarkdown

func ToTimeMarkdown(mt *metav1.Time) string

ToTimeMarkdown returns a formatted time as markdown

func ToTimestamp

func ToTimestamp(t *metav1.Time) component.Component

func ViewPipelineLogs

func ViewPipelineLogs(ns, podName string, containers ...string) (*component.Logs, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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