controllers

package
v0.0.0-...-786acf3 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IndexIntegrations = "index_integrations"
	EditIntegration   = "edit_integration"
)
View Source
const (
	LIMIT = 1
)

Variables

This section is empty.

Functions

This section is empty.

Types

type IntegrationForm

type IntegrationForm struct {
	Org   string `schema:"org"`
	Token string `schema:"token"`
}

IntegrationForm is for processing the IntegrationForm

type Integrations

type Integrations struct {
	New        *views.View
	ShowView   *views.View
	EditView   *views.View
	IndexView  *views.View
	ResultView *views.View
	// contains filtered or unexported fields
}

Integrations contains the user's integrations for CRUD

func NewIntegrations

func NewIntegrations(gs models.IntegrationService, r *mux.Router) *Integrations

NewIntegrations is for creating a new integration

func (*Integrations) Create

func (g *Integrations) Create(w http.ResponseWriter, r *http.Request)

Create uses the POST HTTP method with path being /integrations

func (*Integrations) Delete

func (g *Integrations) Delete(w http.ResponseWriter, r *http.Request)

Delete <=> POST /integrations/:id/delete

func (*Integrations) Edit

func (g *Integrations) Edit(w http.ResponseWriter, r *http.Request)

Edit <=> GET /integrations/:id/edit

func (*Integrations) Index

func (g *Integrations) Index(w http.ResponseWriter, r *http.Request)

Index <=> GET /integrations

func (*Integrations) Result

func (re *Integrations) Result(w http.ResponseWriter, r *http.Request)

Result renders result view.

func (*Integrations) Scan

func (g *Integrations) Scan(w http.ResponseWriter, r *http.Request)

Scan uses the POST HTTP method with path being /integrations/scan

func (*Integrations) Update

func (g *Integrations) Update(w http.ResponseWriter, r *http.Request)

Update an existing integration

type LoginForm

type LoginForm struct {
	Email    string `schema:"email"`
	Password string `schema:"password"`
}

LoginForm holds the expected data for the login in form for returning users

type Repo

type Repo struct {
	UserID      uint   `gorm:"not_null;index"`
	Name        string `gorm:"not_null"`
	Protections bool   `gorm:"not_null"`
	CQL         bool   `gorm:"not_null"`
	Secrets     bool   `gorm:"not_null"`
	Dependabot  bool   `gorm:"not_null"`
}

type SignupForm

type SignupForm struct {
	UserName string `schema:"username"`
	Email    string `schema:"email"`
	Password string `schema:"password"`
}

SignupForm holds the expected data for the sign-up form for users to interact with

type Static

type Static struct {
	Home      *views.View
	Pricing   *views.View
	Limit     *views.View
	Privacy   *views.View
	Business  *views.View
	Breaches  *views.View
	Automatic *views.View
	Team      *views.View
}

Static contains the webpages that are not rendering dynamic content

func NewStatic

func NewStatic() *Static

NewStatic returns the Static webpages for the web app.

type Users

type Users struct {
	NewView   *views.View
	LoginView *views.View
	// contains filtered or unexported fields
}

Users presents the view and what a user (us) can do

func NewUsers

func NewUsers(us models.UserService) *Users

NewUsers defines the views for users that do not have an account

func (*Users) CookieTest

func (u *Users) CookieTest(w http.ResponseWriter, r *http.Request)

CookieTest is for debugging in dev. to see that the user data is being stored and returned

func (*Users) Create

func (u *Users) Create(w http.ResponseWriter, r *http.Request)

Create processes the sign-up form and stores a new user record in the database

func (*Users) Login

func (u *Users) Login(w http.ResponseWriter, r *http.Request)

Login processes the user's login attempt to the application

func (*Users) Logout

func (u *Users) Logout(w http.ResponseWriter, r *http.Request)

Logout is used to delete a user's session cookie and invalidate their current remember token, which will sign the current user out.

POST /logout

func (*Users) New

func (u *Users) New(w http.ResponseWriter, r *http.Request)

New Renders the NewView for users

Jump to

Keyboard shortcuts

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