util

package
v0.1.2-0...-0d018a7 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Copyright 2019, Oath Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HomeDir

func HomeDir() string

HomeDir - check evironment and return home directory Shared Functions with main.go and e2e test

Types

type Util

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

Util - struct with 2 fields adminDomain and list of system namespaces

func NewUtil

func NewUtil(adminDomain string, systemNamespaces []string) *Util

NewUtil - create new Util object

func (*Util) DomainToNamespace

func (u *Util) DomainToNamespace(domain string) (namespace string)

DomainToNamespace will convert an athenz domain to a kubernetes namespace. Dots are converted to dashes and dashes are converted to double dashes. ex: k8s.athenz-istio-auth -> k8s-athenz--istio--auth

func (*Util) GetAdminDomain

func (u *Util) GetAdminDomain() string

GetAdminDomain - getter func for admin domain

func (*Util) GetSystemNSDomains

func (u *Util) GetSystemNSDomains() []string

GetSystemNSDomains - getter func for system ns

func (*Util) IsAdminDomain

func (u *Util) IsAdminDomain(domain string) bool

IsAdminDomain - check if domain is admin domain

func (*Util) IsSystemDomain

func (u *Util) IsSystemDomain(domain string) bool

IsSystemDomain - check if the current domain is a system domain

func (*Util) NamespaceToDomain

func (u *Util) NamespaceToDomain(ns string) (domain string)

NamespaceToDomain will convert the kubernetes namespace to an athenz domain. Dashes are converted to dots and double dashes are converted to single dashes. ex: k8s-athenz--istio--auth -> k8s.athenz-istio-auth

Jump to

Keyboard shortcuts

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