handlers

package
v0.0.0-...-3bd2bae Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2025 License: GPL-3.0 Imports: 40 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func API

func API(
	log *logrus.Logger,
	registry *prometheus.Registry,
	db *db.MongoDB,
	es *es.Elastic,
	neoClient *neo.Neo,
	mw []func(http.Handler) http.Handler,
	authenticator auth.Authenticator,
	externalAuth map[string]*oauth2.Config,
	mail *mailer.Mailer,
	twillio *twillio.Twillio,
	twtt *anaconda.TwitterApi,
	scrape scrape_pb.ScrapeServiceClient,
	cfg *config.Config) http.Handler

API returns a handler for a set of routes

func RandomPassword

func RandomPassword(n int) string

RandomPassword Generates a Random Password

Types

type Account

type Account struct {
	DB             *db.MongoDB
	TokenGenerator account.TokenGenerator
	// contains filtered or unexported fields
}

Account is the our handler struct for user specific requests

func (*Account) Create

func (u *Account) Create() http.HandlerFunc

Create a new account.

func (*Account) Delete

func (u *Account) Delete() http.HandlerFunc

Delete delete an existing user from an id.

func (*Account) Get

func (u *Account) Get() http.HandlerFunc

Get returns an existing user from an id.

func (*Account) List

func (u *Account) List() http.HandlerFunc

List returns all the existing user in the system.

func (*Account) Login

func (u *Account) Login() http.HandlerFunc

Login handles a request to authenticate a account. It expects a request using Basic Auth with a user's email and password. It responds with the user model.

func (*Account) OAuthGoogle

func (u *Account) OAuthGoogle() http.HandlerFunc

OAuthGoogle Handler

func (*Account) OAuthGoogleCB

func (u *Account) OAuthGoogleCB() http.HandlerFunc

OAuthGoogleCB Callback

func (*Account) Reset

func (u *Account) Reset() http.HandlerFunc

Reset passowrd request.

func (*Account) ResetVerify

func (u *Account) ResetVerify() http.HandlerFunc

ResetVerify password request.

func (*Account) Token

func (u *Account) Token() http.HandlerFunc

Token handles a request to authenticate a account. It expects a request using Basic Auth with a user's email and password. It responds with a JWT.

func (*Account) Update

func (u *Account) Update() http.HandlerFunc

Update an existing account.

func (*Account) Verify

func (u *Account) Verify() http.HandlerFunc

Verify OTP

type Articles

type Articles struct {
	// contains filtered or unexported fields
}

func NewArticlesHandler

func NewArticlesHandler(log *logrus.Logger, db *db.MongoDB, es *es.Elastic, neo4j *neo.Neo, scrape scrape_pb.ScrapeServiceClient) *Articles

func (*Articles) Get

func (handler *Articles) Get() http.HandlerFunc

func (*Articles) List

func (handler *Articles) List() http.HandlerFunc

q, from, to, title, body, feeds, topics, skip

func (*Articles) ParseArticle

func (handler *Articles) ParseArticle() http.HandlerFunc

type Cases

type Cases struct {
	// contains filtered or unexported fields
}

func NewCasesHandler

func NewCasesHandler(log *logrus.Logger, db *db.MongoDB, es *es.Elastic, neo4j *neo.Neo) *Cases

func (*Cases) Count

func (handler *Cases) Count() http.HandlerFunc

func (*Cases) Get

func (handler *Cases) Get() http.HandlerFunc

func (*Cases) List

func (handler *Cases) List() http.HandlerFunc

type Feeds

type Feeds struct {
	DB *db.MongoDB
	// contains filtered or unexported fields
}

Feeds is the handler struct for org related enbpoints

func (*Feeds) Create

func (u *Feeds) Create() http.HandlerFunc

func (*Feeds) Delete

func (u *Feeds) Delete() http.HandlerFunc

Delete an existing organization from an id.

func (*Feeds) Export

func (u *Feeds) Export() http.HandlerFunc

func (*Feeds) Get

func (u *Feeds) Get() http.HandlerFunc

func (*Feeds) Import

func (u *Feeds) Import() http.HandlerFunc

func (*Feeds) List

func (u *Feeds) List() http.HandlerFunc

List returns all the existing user in the system.

func (*Feeds) Update

func (u *Feeds) Update() http.HandlerFunc

type Organization

type Organization struct {
	DB *db.MongoDB
	// contains filtered or unexported fields
}

Organization is the handler struct for org related enbpoints

func (*Organization) Create

func (u *Organization) Create() http.HandlerFunc

func (*Organization) Delete

func (u *Organization) Delete() http.HandlerFunc

Delete an existing organization from an id.

func (*Organization) Get

func (u *Organization) Get() http.HandlerFunc

func (*Organization) List

func (u *Organization) List() http.HandlerFunc

List returns all the existing user in the system.

func (*Organization) ProccessInvitation

func (u *Organization) ProccessInvitation() http.HandlerFunc

func (*Organization) RemoveMember

func (u *Organization) RemoveMember() http.HandlerFunc

func (*Organization) Update

func (u *Organization) Update() http.HandlerFunc

func (*Organization) UpsertMember

func (u *Organization) UpsertMember() http.HandlerFunc

type Passages

type Passages struct {
	DB *db.MongoDB
	// contains filtered or unexported fields
}

Passages is the handler struct for org related enbpoints

func (*Passages) Create

func (u *Passages) Create() http.HandlerFunc

Create new passage

func (*Passages) Reload

func (u *Passages) Reload() http.HandlerFunc

Reload passages

type Reports

type Reports struct {
	DB *db.MongoDB
	// contains filtered or unexported fields
}

Reports is the our handler struct for reports api

func (*Reports) Create

func (u *Reports) Create() http.HandlerFunc

func (*Reports) Get

func (u *Reports) Get() http.HandlerFunc

func (*Reports) List

func (u *Reports) List() http.HandlerFunc

List returns all the existing user in the system.

type Subscription

type Subscription struct {
	DB *db.MongoDB

	StripeKey string
	// contains filtered or unexported fields
}

Subscription is the handler struct for org related enbpoints

func (*Subscription) CreateCustomer

func (u *Subscription) CreateCustomer() http.HandlerFunc

func (*Subscription) CreateSession

func (u *Subscription) CreateSession() http.HandlerFunc

func (*Subscription) Delete

func (u *Subscription) Delete() http.HandlerFunc

Delete an existing organization from an id.

func (*Subscription) Get

func (u *Subscription) Get() http.HandlerFunc

Get ...

func (*Subscription) Update

func (u *Subscription) Update() http.HandlerFunc

type Twitter

type Twitter struct {
	// contains filtered or unexported fields
}

Twitter is the handler struct for org related enbpoints

func (*Twitter) Profile

func (u *Twitter) Profile() http.HandlerFunc

Profile retrieves a user profile from twitter

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳