context

package
v0.0.12-0...-8471e6b Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2019 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contexter

func Contexter() macaron.Handler

Contexter injects context.Context into macaron

Types

type Context

type Context struct {
	*macaron.Context
	Flash   *session.Flash
	Session session.Store

	Client      *github.Client
	GiteaClient *gitea.Client
	User        *User //GitHub user
	GiteaUser   *User
	Link        string // current request URL
}

Context represents context of a request.

func (*Context) GetCurrentJob

func (ctx *Context) GetCurrentJob() *migrations.Job

GetCurrentJob returns the current job of the user Bug(JonasFranzDEV): prevents scalability (FIXME)

func (*Context) Handle

func (ctx *Context) Handle(status int, title string, err error)

Handle displays the corresponding error message

func (*Context) SetCurrentJob

func (ctx *Context) SetCurrentJob(job *migrations.Job)

SetCurrentJob sets the current job of the user Bug(JonasFranzDEV): prevents scalability (FIXME)

type User

type User struct {
	ID        int64
	Username  string
	AvatarURL string
	Token     string
}

User is an abstraction of a Gitea or GitHub user, saving the required information

Jump to

Keyboard shortcuts

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