server

package
v0.0.0-...-54a4899 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2022 License: MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	STATIC_DIR = "/new/"
)

Variables

This section is empty.

Functions

func Account

func Account(w http.ResponseWriter, r *http.Request)

func ApiCounter

func ApiCounter(w http.ResponseWriter, r *http.Request)

func ApiCounterAdd

func ApiCounterAdd(w http.ResponseWriter, r *http.Request)

func ApiCounterFrontend

func ApiCounterFrontend(w http.ResponseWriter, r *http.Request)

func ApiCounterList

func ApiCounterList(w http.ResponseWriter, r *http.Request)

func ApiCounterListPagination

func ApiCounterListPagination(w http.ResponseWriter, r *http.Request)

func ApiCounterStart

func ApiCounterStart(w http.ResponseWriter, r *http.Request)

func ApiCounterStartFrontend

func ApiCounterStartFrontend(w http.ResponseWriter, r *http.Request)

func ApiCounterStop

func ApiCounterStop(w http.ResponseWriter, r *http.Request)

func ApiCounterStopFrontend

func ApiCounterStopFrontend(w http.ResponseWriter, r *http.Request)

func ApiDeviceList

func ApiDeviceList(w http.ResponseWriter, r *http.Request)

func ApiEvent

func ApiEvent(w http.ResponseWriter, r *http.Request)

Android

func ApiEventList

func ApiEventList(w http.ResponseWriter, r *http.Request)

func ApiLogin

func ApiLogin(w http.ResponseWriter, r *http.Request)

func ApiNewDevice

func ApiNewDevice(w http.ResponseWriter, r *http.Request)

func ApiNewProject

func ApiNewProject(w http.ResponseWriter, r *http.Request)

func ApiNewUser

func ApiNewUser(w http.ResponseWriter, r *http.Request)

func ApiNote

func ApiNote(w http.ResponseWriter, r *http.Request)

func ApiNoteDelete

func ApiNoteDelete(w http.ResponseWriter, r *http.Request)

func ApiNoteEdit

func ApiNoteEdit(w http.ResponseWriter, r *http.Request)

func ApiNoteList

func ApiNoteList(w http.ResponseWriter, r *http.Request)

func ApiNoteNew

func ApiNoteNew(w http.ResponseWriter, r *http.Request)

func ApiProjectList

func ApiProjectList(w http.ResponseWriter, r *http.Request)

func ApiPushRegister

func ApiPushRegister(w http.ResponseWriter, r *http.Request)

func ApiTaskCreate

func ApiTaskCreate(w http.ResponseWriter, r *http.Request)

func ApiTaskEdit

func ApiTaskEdit(w http.ResponseWriter, r *http.Request)

func ApiTaskList

func ApiTaskList(w http.ResponseWriter, r *http.Request)

func ApiUserList

func ApiUserList(w http.ResponseWriter, r *http.Request)

func CheckApiAuth

func CheckApiAuth(w http.ResponseWriter, r *http.Request) (ok bool, user model.User)

func CheckAuth

func CheckAuth(w http.ResponseWriter, r *http.Request) (ok bool, user model.User)

func CountLog

func CountLog(w http.ResponseWriter, r *http.Request)

func DeviceApiCheckAuth

func DeviceApiCheckAuth(w http.ResponseWriter, r *http.Request) (ok bool, device model.Device)

func FilePaginate

func FilePaginate(w http.ResponseWriter, r *http.Request)

func FileSimilar

func FileSimilar(w http.ResponseWriter, r *http.Request)

func FullImg

func FullImg(w http.ResponseWriter, r *http.Request)

func GitlabWhIssueToDiscord

func GitlabWhIssueToDiscord(w http.ResponseWriter, r *http.Request)

func Index

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

func Login

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

func Logout

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

func OneFile

func OneFile(w http.ResponseWriter, r *http.Request)

func Refresh

func Refresh(w http.ResponseWriter, r *http.Request)

func Register

func Register(w http.ResponseWriter, r *http.Request)

func Scan

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

func SendDiscordWebhook

func SendDiscordWebhook(bodyRaw DiscordWebhook, discordWhUrl string, w http.ResponseWriter)

func StartWebInterface

func StartWebInterface()

func TagAdd

func TagAdd(w http.ResponseWriter, r *http.Request)

func TagDelete

func TagDelete(w http.ResponseWriter, r *http.Request)

func TagList

func TagList(w http.ResponseWriter, r *http.Request)

func TagListForFiles

func TagListForFiles(w http.ResponseWriter, r *http.Request)

separate endpoint for tags allows to construct simpler and faster SQL queries for images

func Thumb

func Thumb(w http.ResponseWriter, r *http.Request)

func WebhookGitlab

func WebhookGitlab(w http.ResponseWriter, r *http.Request)

Types

type AccountPage

type AccountPage struct {
	AuthOk   bool
	User     model.User
	Projects []model.Project
	Devices  []model.Device
}

type ApiLoginRequest

type ApiLoginRequest struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

type ApiLoginResponse

type ApiLoginResponse struct {
	Token string `json:"token"`
}

type ApiNewDeviceRequest

type ApiNewDeviceRequest struct {
	Name string `json:"name"`
}

type ApiNewProjectRequest

type ApiNewProjectRequest struct {
	Name    string `json:"name"`
	GroupId uint   `json:"groupId"`
}

type ApiNewUserRequest

type ApiNewUserRequest struct {
	Username string `json:"username"`
	Password string `json:"password"`
	Email    string `json:"email"`
}

type Assignee

type Assignee struct {
	Name      string `json:"name"`
	Username  string `json:"username"`
	AvatarURL string `json:"avatar_url"`
}

type Changes

type Changes struct {
	UpdatedByID UpdatedByID `json:"updated_by_id"`
	UpdatedAt   UpdatedAt   `json:"updated_at"`
	Labels      Labels      `json:"labels"`
}

type CountLogPage

type CountLogPage struct {
	AuthOk         bool
	User           model.User
	Counters       []model.CounterSessionList
	CounterRunning bool
}

type CounterApi

type CounterApi struct {
	Id         uint              `json:"id"`
	Name       string            `json:"name"`
	Tags       []string          `json:"tags"`
	Seconds    uint              `json:"seconds"`
	SecondsF   string            `json:"secondsF"`
	InProgress bool              `json:"inProgress"`
	Stats      model.CounterList `json:"stats"`
	Sessions   []CounterLogApi   `json:"sessions"`
}

type CounterApiPagination

type CounterApiPagination struct {
	Pagination struct {
		AllRecords int `json:"allRecords"`
	} `json:"pagination"`
	Counters []CounterApi `json:"counters"`
}

type CounterLogApi

type CounterLogApi struct {
	Duration          uint      `json:"durationS"`
	DurationFormatted string    `json:"durationSF"`
	Start             time.Time `json:"start"`
	End               time.Time `json:"end"`
}

type DiscordWhEmbed

type DiscordWhEmbed struct {
	Title       string `json:"title"`
	Description string `json:"description"`
	Url         string `json:"url"`
	// https://www.spycolor.com/
	Color  int                  `json:"color"`
	Author DiscordWhEmbedAuthor `json:"author"`
	Fields []DiscordWhFields    `json:"fields"`
}

type DiscordWhEmbedAuthor

type DiscordWhEmbedAuthor struct {
	Name           string `json:"name"`
	Url            string `json:"url"`
	Icon_url       string `json:"icon_url"`
	Proxy_icon_url string `json:"proxy_icon_url"`
}

type DiscordWhFields

type DiscordWhFields struct {
	Name   string `json:"name"`
	Value  string `json:"value"`
	Inline bool   `json:"inline"`
}

type EditTaskApiReq

type EditTaskApiReq struct {
	Id          int        `json:"id"`
	Title       string     `json:"title"`
	Snooze      *time.Time `json:"snoozeTo"`
	Delete      bool       `json:"delete"`
	Done        bool       `json:"done"`
	AssignTo    int        `json:"assignTo"`
	RepeatUnit  string     `json:"repeatUnit"`
	RepeatEvery int        `json:"repeatEvery"`
}

type GitlabIssueWebhook

type GitlabIssueWebhook struct {
	ObjectKind       string           `json:"object_kind"`
	User             Assignee         `json:"user"`
	Project          Project          `json:"project"`
	Repository       Repository       `json:"repository"`
	ObjectAttributes ObjectAttributes `json:"object_attributes"`
	Assignees        []Assignee       `json:"assignees"`
	Assignee         Assignee         `json:"assignee"`
	Labels           []Label          `json:"labels"`
	Changes          Changes          `json:"changes"`
}

type IncomingEvent

type IncomingEvent struct {
	Status struct {
		Screen  string `json:"scr"`
		Battery uint   `json:"bat"`
	} `json:"stat"`
	Music struct {
		Track  string `json:"trk"`
		Artist string `json:"art"`
	} `json:"music"`
	Version uint   `json:"v"`
	Token   string `json:"tok"`
}

Android

type Label

type Label struct {
	ID          int64  `json:"id"`
	Title       string `json:"title"`
	Color       string `json:"color"`
	ProjectID   int64  `json:"project_id"`
	CreatedAt   string `json:"created_at"`
	UpdatedAt   string `json:"updated_at"`
	Template    bool   `json:"template"`
	Description string `json:"description"`
	Type        string `json:"type"`
	GroupID     int64  `json:"group_id"`
}

type Labels

type Labels struct {
	Previous []Label `json:"previous"`
	Current  []Label `json:"current"`
}

type LoginPage

type LoginPage struct {
	AuthFailed bool
	RegisterOn bool
	AuthOk     bool
}

https://www.sohamkamani.com/blog/2018/03/25/golang-session-authentication/

type NewCounterRequest

type NewCounterRequest struct {
	Tag  string `json:"tag"`
	Name string `json:"name"`
}

type NewTaskApiReq

type NewTaskApiReq struct {
	Title string `json:"title"`
}

type NoteApiResponse

type NoteApiResponse struct {
	Id        uint       `json:"id"`
	Title     string     `json:"title"`
	Short     string     `json:"short"`
	Tags      string     `json:"tags"`
	CreatedAt *time.Time `json:"createdAt"`
}

type ObjectAttributes

type ObjectAttributes struct {
	ID          int64       `json:"id"`
	Title       string      `json:"title"`
	AssigneeIDS []int64     `json:"assignee_ids"`
	AssigneeID  int64       `json:"assignee_id"`
	AuthorID    int64       `json:"author_id"`
	ProjectID   int64       `json:"project_id"`
	CreatedAt   string      `json:"created_at"`
	UpdatedAt   string      `json:"updated_at"`
	Position    int64       `json:"position"`
	BranchName  interface{} `json:"branch_name"`
	Description string      `json:"description"`
	MilestoneID interface{} `json:"milestone_id"`
	State       string      `json:"state"`
	Iid         int64       `json:"iid"`
	URL         string      `json:"url"`
	Action      string      `json:"action"`
}

type OneNoteApi

type OneNoteApi struct {
	Id        uint       `json:"id"`
	Title     string     `json:"title"`
	Body      string     `json:"body"`
	Tags      string     `json:"tags"`
	CreatedAt *time.Time `json:"createdAt"`
}

FIXME for note edit

type PaginateFileResponse

type PaginateFileResponse struct {
	Pagination struct {
		AllRecords int `json:"allRecords"`
	} `json:"pagination"`
	Files []model.File `json:"files"`
}

type PaginateQueryRequest

type PaginateQueryRequest struct {
	Query string `json:"q"`
}

type Project

type Project struct {
	ID                int64       `json:"id"`
	Name              string      `json:"name"`
	Description       string      `json:"description"`
	WebURL            string      `json:"web_url"`
	AvatarURL         interface{} `json:"avatar_url"`
	GitSSHURL         string      `json:"git_ssh_url"`
	GitHTTPURL        string      `json:"git_http_url"`
	Namespace         string      `json:"namespace"`
	VisibilityLevel   int64       `json:"visibility_level"`
	PathWithNamespace string      `json:"path_with_namespace"`
	DefaultBranch     string      `json:"default_branch"`
	Homepage          string      `json:"homepage"`
	URL               string      `json:"url"`
	SSHURL            string      `json:"ssh_url"`
	HTTPURL           string      `json:"http_url"`
}

type PushRegisterRequest

type PushRegisterRequest struct {
	PushToken string `json:"pushToken"`
}

type RegisterPage

type RegisterPage struct {
	AuthOk              bool
	RegisterFailed      bool
	RegisterTokenNeeded bool
}

https://www.sohamkamani.com/blog/2018/03/25/golang-session-authentication/

type Repository

type Repository struct {
	Name        string `json:"name"`
	URL         string `json:"url"`
	Description string `json:"description"`
	Homepage    string `json:"homepage"`
}

type ScanReq

type ScanReq struct {
	Path string `json:"path"`
}

type TagRequest

type TagRequest struct {
	Tag string `json:"tag"`
}

type TaskApiResponse

type TaskApiResponse struct {
	Id          int        `json:"id"`
	Title       string     `json:"title"`
	AssignedTo  int        `json:"assignedTo"`
	RepeatUnit  string     `json:"repeatUnit"`
	RepeatEvery int        `json:"repeatEvery"`
	CreatedAt   *time.Time `json:"createdAt"`
}

type TasksPage

type TasksPage struct {
	AuthOk     bool
	Tasks      []model.Task
	TasksCount uint
	User       model.User
	Project    model.Project
	Inspire    string
}

type UpdatedAt

type UpdatedAt struct {
	Previous string `json:"previous"`
	Current  string `json:"current"`
}

type UpdatedByID

type UpdatedByID struct {
	Previous interface{} `json:"previous"`
	Current  int64       `json:"current"`
}

type UserListRes

type UserListRes struct {
	Id       int    `json:"id"`
	Username string `json:"username"`
}

Jump to

Keyboard shortcuts

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