server

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2022 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ActiveDns

func ActiveDns() ([]string, error)

func CloseInterceptApp

func CloseInterceptApp(appId string) error

func CreateDevice

func CreateDevice(deviceName string) error

func CreateRemoteLogin

func CreateRemoteLogin() (loginId string, err error)

func CurrentAccountId

func CurrentAccountId() (string, error)

func CurrentDeviceId

func CurrentDeviceId() (string, error)

func CurrentProjectId

func CurrentProjectId() (string, error)

func DeleteDevicePort

func DeleteDevicePort(ports []Port) error

func GetConfigPath

func GetConfigPath() string

func GetEnvs

func GetEnvs(appId string) (string, error)

func InterceptApp

func InterceptApp(devieId, appId string) error

func Login

func Login(loginId string) error

func SetActiveDns

func SetActiveDns(dns []string) error

func UpdateDevice

func UpdateDevice(ports []Port, region *string) error

func WriteContextFile

func WriteContextFile(fileObj KLContext) error

func WriteKLFile

func WriteKLFile(fileObj KLFileType) error

Types

type Account

type Account struct {
	Id   string `json:"id"`
	Name string `json:"name"`
}

func GetAccounts

func GetAccounts() ([]Account, error)

type App

type App struct {
	IsLambda   bool   `json:"isLambda"`
	Id         string `json:"id"`
	Name       string `json:"name"`
	ReadableId string `json:"readableId"`
	Containers []struct {
		Name    string `json:"name"`
		EnvVars []struct {
			Key   string `json:"key"`
			Value struct {
				Key   string `json:"key"`
				Ref   string `json:"ref"`
				Type  string `json:"type"`
				Value string `json:"value"`
			} `json:"value"`
		} `json:"envVars"`
	} `json:"containers"`
}

func GetApp

func GetApp(appId string) (*App, error)

func GetApps

func GetApps(options ...common.Option) ([]App, error)

type CSEntry

type CSEntry struct {
	Value string `json:"value"`
	Key   string `json:"key"`
}

type Config

type Config struct {
	Entries []CSEntry `json:"entries"`
	Name    string    `json:"name"`
	Id      string    `json:"id"`
}

func GetConfig

func GetConfig(id string) (*Config, error)

func GetConfigs

func GetConfigs(options ...common.Option) ([]Config, error)

func GetSecret

func GetSecret(id string) (*Config, error)

type ConfigORSecret

type ConfigORSecret struct {
	Entries []CSEntry `json:"entries"`
	Name    string    `json:"name"`
}

type DAccount

type DAccount struct {
	Devices []Device `json:"devices"`
}

type DApp

type DApp struct {
	ReadableId string `json:"readableId"`
	Name       string `json:"name"`
	Id         string `json:"id"`
}

type Device

type Device struct {
	Region        string            `json:"region"`
	Ports         []Port            `json:"ports"`
	Configuration map[string]string `json:"configuration"`
	Name          string            `json:"name"`
	Id            string            `json:"id"`
	Intercepted   []DApp            `json:"interceptingServices"`
}

func GetDevice added in v1.0.3

func GetDevice(deviceId string) (*Device, error)

func GetDevices

func GetDevices(options ...common.Option) ([]Device, error)

type EnvType

type EnvType struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

type FileEntry

type FileEntry struct {
	Path string `json:"path"`
	Type string `json:"type"`
	Name string `json:"Name"`
}

type GeneratedEnvs

type GeneratedEnvs struct {
	EnvVars    map[string]string `json:"envVars"`
	MountFiles map[string]string `json:"mountFiles"`
}

func GenerateEnv

func GenerateEnv() (*GeneratedEnvs, error)

type KLContext

type KLContext struct {
	ProjectId string
	AccountId string
	DeviceId  string
	Session   string
	KlFile    string
	DNS       []string
}

func GetContextFile

func GetContextFile() (*KLContext, error)

type KLFileType

type KLFileType struct {
	Version string    `json:"version"`
	Name    string    `json:"name"`
	Mres    []ResType `json:"mres"`
	Configs []ResType `json:"configs"`
	Secrets []ResType `json:"secrets"`
	Env     []EnvType `json:"env"`
	// Ports     []string  `json:"ports"`
	FileMount MountType `yaml:"fileMount"`
}

func GetKlFile

func GetKlFile(filePath *string) (*KLFileType, error)

type MountType

type MountType struct {
	MountBasePath string      `yaml:"mountBasePath" json:"mountBasePath"`
	Mounts        []FileEntry `json:"mounts"`
}

type Mres

type Mres struct {
	Name      string
	Source    string
	Resources []ResourceType
}

func GetMreses

func GetMreses() ([]*Mres, []mCategory, error)

type MresMarketCategories

type MresMarketCategories struct {
	Categories []mCategory
}

type MresMarketItem

type MresMarketItem struct {
	Active      bool
	DisplayName string `json:"display_name"`
	Name        string
	Resources   []struct {
		DisplayName string
		Name        string
		Outputs     Outputs
	}
}

type Outputs

type Outputs []struct {
	Label string
	Name  string
}

type Port

type Port struct {
	Port       int `json:"port"`
	TargetPort int `json:"targetPort,omitempty"`
}

type Project

type Project struct {
	Id          string `json:"id"`
	ReadableId  string `json:"readableId"`
	DisplayName string `json:"displayName"`
	Name        string `json:"name"`
	Description string `json:"description"`
}

func GetProjects

func GetProjects(options ...common.Option) ([]Project, error)

type Provider

type Provider struct {
	Name     string   `json:"Name"`
	Provider string   `json:"provider"`
	Edges    []Region `json:"edges"`
}

type Region

type Region struct {
	Id       string `json:"Id"`
	Name     string `json:"Name"`
	Region   string `json:"region"`
	Provider string
}

func GetRegions

func GetRegions(options ...common.Option) ([]Region, error)

type ResEnvType

type ResEnvType struct {
	Name   *string `json:"name,omitempty" yaml:"name,omitempty"`
	Key    string  `json:"key"`
	RefKey string  `json:"refKey"`
}

type ResType

type ResType struct {
	Name string       `json:"name"`
	Env  []ResEnvType `json:"env"`
}

type ResourceType

type ResourceType struct {
	Name string
	// Outputs      map[string]string
	ResourceType string
}

type Secret

type Secret struct {
	Entries []CSEntry `json:"entries"`
	Name    string    `json:"name"`
	Id      string    `json:"id"`
}

func GetSecrets

func GetSecrets(options ...common.Option) ([]Secret, error)

type User

type User struct {
	UserId string `json:"userId"`
}

Jump to

Keyboard shortcuts

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