v1

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2020 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func API

API returns an http.Handler which handles all of the /api/v1/* routes

func GenerateAccessToken added in v0.2.0

func GenerateAccessToken(user taskforge.User) (string, error)

GenerateAccessToken generates a valid JWT with claims for the given user

Types

type State

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

State holds any globals which the HTTP handler functions need access to

func (State) CompleteTask added in v0.2.0

func (s State) CompleteTask(w http.ResponseWriter, r *http.Request)

CompleteTask completes a single task by ID from the Repository's TaskService

func (State) CreateComment

func (s State) CreateComment(w http.ResponseWriter, r *http.Request)

CreateComment uses the given JSON body then if, that body passes validation, creates it using the Repository's CommentService

func (State) CreateContext

func (s State) CreateContext(w http.ResponseWriter, r *http.Request)

CreateContext uses the given JSON body then if, that body passes validation, creates it using the Repository's ContextService

func (State) CreateSource

func (s State) CreateSource(w http.ResponseWriter, r *http.Request)

CreateSource uses the given JSON body then if, that body passes validation, creates it using the Repository's SourceService

func (State) CreateTask

func (s State) CreateTask(w http.ResponseWriter, r *http.Request)

CreateTask uses the given JSON body then if, that body passes validation, creates it using the Repository's TaskService

func (State) CreateUser

func (s State) CreateUser(w http.ResponseWriter, r *http.Request)

CreateUser uses the given JSON body then if, that body passes validation, creates it using the Repository's UserService

func (State) CurrentTask

func (s State) CurrentTask(w http.ResponseWriter, r *http.Request)

CurrentTask retrieves the current task for the user, this is defined as the highest priority or oldest uncompleted task

func (State) DeleteComment

func (s State) DeleteComment(w http.ResponseWriter, r *http.Request)

DeleteComment delets a comment by ID if the user has permission

func (State) DeleteContext

func (s State) DeleteContext(w http.ResponseWriter, r *http.Request)

DeleteContext delets a context by ID if the user has permission

func (State) DeleteSource

func (s State) DeleteSource(w http.ResponseWriter, r *http.Request)

DeleteSource delets a source by ID if the user has permission

func (State) DeleteTask

func (s State) DeleteTask(w http.ResponseWriter, r *http.Request)

DeleteTask delets a task by ID if the user has permission

func (State) DeleteUser

func (s State) DeleteUser(w http.ResponseWriter, r *http.Request)

DeleteUser deletes a user by ID if ID is the authenticated users own ID

func (State) GetComment

func (s State) GetComment(w http.ResponseWriter, r *http.Request)

GetComment retrieves a single comment by ID from the Repository's CommentService

func (State) GetContext

func (s State) GetContext(w http.ResponseWriter, r *http.Request)

GetContext retrieves a single context by ID from the Repository's ContextService

func (State) GetSource

func (s State) GetSource(w http.ResponseWriter, r *http.Request)

GetSource retrieves a single source by ID from the Repository's SourceService

func (State) GetTask

func (s State) GetTask(w http.ResponseWriter, r *http.Request)

GetTask retrieves a single task by ID from the Repository's TaskService

func (State) GetUser

func (s State) GetUser(w http.ResponseWriter, r *http.Request)

GetUser retrieves a single user by ID from the Repository's UserService

func (State) ListComments

func (s State) ListComments(w http.ResponseWriter, r *http.Request)

ListComments retrieves all of the comments for the object id provided as a query parameter

func (State) ListContexts

func (s State) ListContexts(w http.ResponseWriter, r *http.Request)

ListContexts retrieves all of the contexts this user has access to

func (State) ListSources

func (s State) ListSources(w http.ResponseWriter, r *http.Request)

ListSources retrieves all of the sources

func (State) ListTasks

func (s State) ListTasks(w http.ResponseWriter, r *http.Request)

ListTasks retrieves all of the tasks for this user, or optionall if the q or query url parameters are given runs the query using the TaskService Search method on the Repository's TaskService

func (State) ListUsers

func (s State) ListUsers(w http.ResponseWriter, r *http.Request)

ListUsers returns a not implemented error

func (State) NewToken

func (s State) NewToken(w http.ResponseWriter, r *http.Request)

NewToken creates a new JWT token for authentication

func (State) RefreshToken

func (s State) RefreshToken(w http.ResponseWriter, r *http.Request)

RefreshToken checks the given refresh token and if valid returns a new access token

func (State) UpdateComment

func (s State) UpdateComment(w http.ResponseWriter, r *http.Request)

UpdateComment updates a comment if the user has permission

func (State) UpdateContext

func (s State) UpdateContext(w http.ResponseWriter, r *http.Request)

UpdateContext updates a context if the user has permission

func (State) UpdateSource

func (s State) UpdateSource(w http.ResponseWriter, r *http.Request)

UpdateSource updates a source if the user has permission

func (State) UpdateTask

func (s State) UpdateTask(w http.ResponseWriter, r *http.Request)

UpdateTask updates a task if the user has permission

func (State) UpdateUser

func (s State) UpdateUser(w http.ResponseWriter, r *http.Request)

UpdateUser allows a user to update their information

Jump to

Keyboard shortcuts

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