handlers

package
v0.0.0-...-d9ac2dc Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2024 License: Apache-2.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 Handler

type Handler struct {
	PritunlClient    *pritunl.Client
	PritunlEUClient  *pritunl.Client
	MessageTemplates map[string]string
	Webserver        config.Webserver
	Store            store.Store
	Timezone         *time.Location
}

func New

func New(c, cEU *pritunl.Client, wc config.Webserver, s store.Store, timezone *time.Location, msgTemplates map[string]string) *Handler

func (*Handler) DomainCreate

func (h *Handler) DomainCreate(userId, userName, ip string) (*entities.Domain, error)

func (*Handler) DomainDelete

func (h *Handler) DomainDelete(userId string) (string, error)

func (*Handler) DomainDeleteExpired

func (h *Handler) DomainDeleteExpired() error

DomainDeleteExpired deletes all expired domains

func (*Handler) DomainGetExpirationSoon

func (h *Handler) DomainGetExpirationSoon() ([]*entities.Domain, error)

DomainGetExpirationSoon returns list of domains that will be deleted in 1 day

func (*Handler) DomainGetExpired

func (h *Handler) DomainGetExpired() ([]*entities.Domain, error)

DomainGetExpired returns list of expired domains

func (*Handler) DomainUpdate

func (h *Handler) DomainUpdate(userId, param, value string) (string, error)

func (*Handler) GetVpnWelcomeMessage

func (h *Handler) GetVpnWelcomeMessage() string

func (*Handler) VPNEUDeactivateExpired

func (h *Handler) VPNEUDeactivateExpired() error

VPNEUDeactivateExpired deactivates all expired vpn accounts on the EU server

func (*Handler) VPNEUGetExpirationSoon

func (h *Handler) VPNEUGetExpirationSoon() ([]*entities.VPNEU, error)

VPNEUGetExpirationSoon returns list of VPN accounts on EU server that will be deleted soon

func (*Handler) VPNEUGetExpired

func (h *Handler) VPNEUGetExpired() ([]*entities.VPNEU, error)

VPNEUGetExpired returns list of expired VPN accounts on EU server

func (*Handler) VpnCreateUser

func (h *Handler) VpnCreateUser(login, email string) error

func (*Handler) VpnDeleteUser

func (h *Handler) VpnDeleteUser(email string) error

func (*Handler) VpnGetConfigUrl

func (h *Handler) VpnGetConfigUrl(email string) (string, error)

func (*Handler) VpnGetEUConfigUrl

func (h *Handler) VpnGetEUConfigUrl(login, email, userId string, durationHours int) (string, error)

Jump to

Keyboard shortcuts

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