server

package
v0.0.0-...-15cc223 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2024 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Tags = []string{"boxer"}

The first item in this slice should always be the application identifier This tag will be added to all VPSs on cloud services

Functions

func NewServers

func NewServers(r *Repository, a *config.AppConfig)

NewServer sets the repository for the servers

Types

type Repository

type Repository struct {
	App *config.AppConfig
	DB  repository.DatabaseRepo
}
var Repo *Repository

func NewRepo

func NewRepo(a *config.AppConfig, db *driver.DB) *Repository

NewRepo sets the db repo for SQLite3

func (*Repository) AddSSHKeyToDigitalOcean

func (m *Repository) AddSSHKeyToDigitalOcean() error

AddSSHKey removes all SSH keys from the account and adds a new one

func (*Repository) DigitalOceanCreateServer

func (m *Repository) DigitalOceanCreateServer(server models.Server) (models.Server, error)

DigitalOceanCreateServer creates a droplet on Digital Ocean and returns the server object with the IP address

func (*Repository) DigitalOceanDeleteAll

func (m *Repository) DigitalOceanDeleteAll() error

DigitalOceanDeleteAll deletes all servers created in digital ocean with specified tag

func (*Repository) DigitalOceanDeleteServer

func (m *Repository) DigitalOceanDeleteServer(serverID int) error

DigitalOceanDeleteServer deletes a server from digital ocean based on serverID

func (*Repository) DigitalOceanRefreshVPS

func (m *Repository) DigitalOceanRefreshVPS() ([]models.Server, error)

DigitalOceanRefreshVPS refreshes the list of servers currently deployed on Digital Ocean

func (*Repository) LinodeCreateServer

func (m *Repository) LinodeCreateServer(server models.Server) (models.Server, error)

LinodeCreateServer creates a VPS in Linode based on model

func (*Repository) LinodeDeleteAll

func (m *Repository) LinodeDeleteAll() error

LinodeDeleteAll deletes all VPS hosted on Linode with specified tag

func (*Repository) LinodeDeleteServer

func (m *Repository) LinodeDeleteServer(serverID int) error

LinodeDeleteServer destroys a VPS based on serverID

type TokenSource

type TokenSource struct {
	AccessToken string
}

TokenSource is an oauth2.TokenSource which returns a static access token

func (*TokenSource) Token

func (t *TokenSource) Token() (*oauth2.Token, error)

Token returns the access token

Jump to

Keyboard shortcuts

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