providers

package
v0.0.0-...-e1e7d89 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2020 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	DisplayName string
	Icon        string
	URL         string
	DisplayURL  string
	Enabled     bool
	Added       time.Time
}

type AppProvider

type AppProvider struct {
	PType      string
	TypeConfig interface{}
	Protected  bool
	Priority   uint8
	Apps       map[string]*App
}

func NewAppProvider

func NewAppProvider(name string, ptype string) (*AppProvider, error)

func (*AppProvider) RefreshApps

func (ap *AppProvider) RefreshApps() error

type Docker

type Docker struct {
	Host       string
	Client     *docker.Client
	User       string
	Pass       string
	DefaultEnb bool
	Swarm      bool
}

//----- Models --->

func (*Docker) GetApps

func (dkr *Docker) GetApps() map[string]*App

GetApps fetches all the containers visible fromthe provided Docker client It will however not provide any apps back where the enabled flag was false Returns a map of App formatted containers

func (*Docker) TestConnection

func (dkr *Docker) TestConnection(output bool) bool

TestConnection checks to see if the docker client can be communicated with via the given http client. This is done by checking the version Returns true if communication was possible

func (*Docker) UpgradeApp

func (dkr *Docker) UpgradeApp(matchName string, app *App) (string, bool)

UpgradeApp takes an already existing app and replaces data with defined data an example use case is where you want to overwrite an apps info with the info from docker labels In this case (docker), match name should be the name of the container you want to use Returns true if returning a new suggested app name

type DockerConfig

type DockerConfig struct {
	ConnType   string `json:"connection"`
	ConnPath   string `json:"path"`
	ConnURL    string `json:"url"`
	User       string `json:"user"`
	Pass       string `json:"pass"`
	DefaultEnb bool   `json:"default"`
	Swarm      bool   `json:"swarm"`
}

type DockerContainerConfig

type DockerContainerConfig struct {
	Labels map[string]string `json:"Labels"`
}

type DockerContainerInfo

type DockerContainerInfo struct {
	ID    string   `json:"Id"`
	Names []string `json:"Names"`
	Image string   `json:"Image"`
	//State  string            `json:"State"`
	Labels map[string]string `json:"Labels"`
}

type DockerIndividualInfo

type DockerIndividualInfo struct {
	ID     string                `json:"Id"`
	Name   string                `json:"Names"`
	Config DockerContainerConfig `json:"Config"`
}

type Traefik

type Traefik struct {
	URL     string
	User    string
	Pass    string
	Dockers map[string]*Docker
	Ignore  []string
}

//----- Models --->

func (*Traefik) GetApps

func (tr *Traefik) GetApps() map[string]*App

GetApps fetches all the routers visible fromthe provided traefik instance It will however not provide any apps back where the enabled flag was false if provided with a docker connection Returns a map of App formatted routers

func (*Traefik) TestConnection

func (tr *Traefik) TestConnection(output bool) bool

TestConnection checks to see if traefik can be communicated with via the given url. This is done by checking the version Returns true if communication was possible

type TraefikConfig

type TraefikConfig struct {
	URL     string   `json:"url"`
	Dockers []string `json:"dockers"`
	Ignored []string `json:"ignored"`
	User    string   `json:"user"`
	Pass    string   `json:"pass"`
}

type TraefikRouter

type TraefikRouter struct {
	Name    string `json:"service"`
	RuleStr string `json:"rule"`
	Status  string `json:"status"`
	Enabled bool
}

type TraefikVersion

type TraefikVersion struct {
	Version  string `json:"Version"`
	Codename string `json:"Codename"`
}

Jump to

Keyboard shortcuts

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