routes

package
v0.0.0-...-1e18dc2 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2019 License: CC0-1.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RouteManager

type RouteManager struct {
	// Internal database.
	Db *gorm.DB

	// Inherited from main.
	Logger lager.Logger

	// Global settings from the environment.
	Settings types.Settings

	// AWS IAM.
	IamSvc iamiface.IAMAPI

	// AWS CloudFront.
	CloudFrontSvc cloudfrontiface.CloudFrontAPI

	// AWS ELBv2
	ElbSvc elbv2iface.ELBV2API

	// dns challenger
	Dns challenge.Provider

	// ACME Client, used mostly for testing.
	AcmeHttpClient *http.Client

	// DNS Resolvers
	Resolvers map[string]string
	// contains filtered or unexported fields
}

RouteManager is the worker for managing custom domains. todo (mxplusb): add rate limiter to prevent rate limiting issues with ACME.

func NewManager

func NewManager(logger lager.Logger, iam iamiface.IAMAPI, cloudFront cloudfrontiface.CloudFrontAPI, elbSvc elbv2iface.ELBV2API, settings types.Settings, db *gorm.DB, provider challenge.Provider, acmeClient *http.Client, resolvers map[string]string) (*RouteManager, error)

todo (mxplusb): prolly test this before the broker code.

func (*RouteManager) Create

func (r *RouteManager) Create(instanceId string, domainOpts types.DomainPlanOptions, cdnOpts types.CdnPlanOptions, tags map[string]string) (*models.DomainRoute, error)

Create a new custom domain. todo (mxplusb): add hook for creating a CDN instance.

func (*RouteManager) DeleteOrphanedCerts

func (*RouteManager) DeleteOrphanedCerts()

func (*RouteManager) Disable

func (*RouteManager) Disable(route *models.DomainRoute) error

func (*RouteManager) Get

func (r *RouteManager) Get(instanceId string) (models.DomainRoute, error)

Get the instance by it's instance ID.

func (*RouteManager) GetDNSInstructions

func (r *RouteManager) GetDNSInstructions(route *models.DomainRoute) (leproviders.DomainMessenger, error)

GetDNSInstructions gets the stored DNS instructions from a given

func (*RouteManager) Poll

func (*RouteManager) Poll(route *models.DomainRoute) error

func (*RouteManager) Populate

func (*RouteManager) Populate() error

func (*RouteManager) Renew

func (*RouteManager) Renew(route *models.DomainRoute) error

func (*RouteManager) RenewAll

func (r *RouteManager) RenewAll()

todo (mxplusb): make sure this actually does the thing

func (*RouteManager) Update

func (*RouteManager) Update(instanceId string, domainOpts types.DomainPlanOptions, cdnOpts types.CdnPlanOptions) error

Update is not supported yet.

func (*RouteManager) UpdateElbs

func (r *RouteManager) UpdateElbs()

UpdateElbs is a cron job designed to keep the internal ELB references up-to-date so we don't need to store the info in a database and we can just reference it as needed. This should be run at least once a minute.

Jump to

Keyboard shortcuts

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