url

package
v0.0.0-...-8dda575 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// StateTypePushed means that URL is present both locally and on cluster
	StateTypePushed = "Pushed"
	// StateTypeNotPushed means that URL is only in local config, but not on the cluster
	StateTypeNotPushed = "Not Pushed"
	// StateTypeLocallyDeleted means that URL was deleted from the local config, but it is still present on the cluster
	StateTypeLocallyDeleted = "Locally Deleted"
)

Variables

This section is empty.

Functions

func Create

func Create(client *occlient.Client, urlName string, portNumber int, componentName, applicationName string) (string, error)

Create creates a URL and returns url string and error if any portNumber is the target port number for the route and is -1 in case no port number is specified in which case it is automatically detected for components which expose only one service port)

func Delete

func Delete(client *occlient.Client, urlName string, applicationName string) error

Delete deletes a URL

func Exists

func Exists(client *occlient.Client, urlName string, componentName string, applicationName string) (bool, error)

Exists checks if the url exists in the component or not urlName is the name of the url for checking componentName is the name of the component to which the url's existence is checked applicationName is the name of the application to which the url's existence is checked

func GetURLName

func GetURLName(componentName string, componentPort int) string

GetURLName returns a url name from the component name and the given port number

func GetURLString

func GetURLString(protocol, URL string) string

GetURLString returns a string representation of given url

func GetValidPortNumber

func GetValidPortNumber(componentName string, portNumber int, portList []string) (int, error)

GetValidPortNumber checks if the given port number is a valid component port or not if port number is not provided and the component is a single port component, the component port is returned port number is -1 if the user does not specify any port

Types

type StateType

type StateType string

type URL

type URL struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`
	Spec              URLSpec   `json:"spec,omitempty"`
	Status            URLStatus `json:"status,omitempty"`
}

URL is

func ConvertConfigURL

func ConvertConfigURL(configURL config.ConfigURL) URL

ConvertConfigURL converts ConfigURL to URL

type URLList

type URLList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []URL `json:"items"`
}

AppList is a list of applications

func List

func List(client *occlient.Client, localConfig *config.LocalConfigInfo, componentName string, applicationName string) (URLList, error)

List returns all URLs for given component. If componentName is empty string, it lists all url in a given application.

func ListPushed

func ListPushed(client *occlient.Client, componentName string, applicationName string) (URLList, error)

ListPushed lists the URLs in an application that are in cluster. The results can further be narrowed down if a component name is provided, which will only list URLs for the given component

func (URLList) Get

func (urls URLList) Get(urlName string) URL

Get returns URL defination for given URL name

type URLSpec

type URLSpec struct {
	Host     string `json:"host,omitempty"`
	Protocol string `json:"protocol,omitempty"`
	Port     int    `json:"port,omitempty"`
}

URLSpec is

type URLStatus

type URLStatus struct {
	// "Pushed" or "Not Pushed" or "Locally Delted"
	State StateType `json:"state"`
}

URLStatus is Status of url

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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