webui

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2025 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Overview

Copyright (c) 2025 Chakib Ben Ziane <contact@blob42.xyz> and [`gosuki` contributors](https://github.com/blob42/gosuki/graphs/contributors). All rights reserved.

SPDX-License-Identifier: AGPL-3.0-or-later

This file is part of GoSuki.

GoSuki is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

GoSuki is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with gosuki. If not, see <http://www.gnu.org/licenses/>.

Copyright (c) 2024-2025-2025-2025-2025 Chakib Ben Ziane <contact@blob42.xyz> and [`gosuki` contributors](https://github.com/blob42/gosuki/graphs/contributors). All rights reserved.

SPDX-License-Identifier: AGPL-3.0-or-later

This file is part of GoSuki.

GoSuki is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

GoSuki is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with gosuki. If not, see <http://www.gnu.org/licenses/>.

Index

Constants

View Source
const (
	BindPort = 2025
	BindHost = "0.0.0.0"
)

Variables

View Source
var BindAddr = fmt.Sprintf("%s:%d", BindHost, BindPort)
View Source
var Static embed.FS
View Source
var Templates embed.FS
View Source
var Views embed.FS

Functions

func IndexView

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

func ListBookmarks

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

func NamedView

func NamedView(name string) http.HandlerFunc

View handler that takes a name and parses the view file with same name. The view name must match the URL path. /test -> test.html

func Testview

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

Types

type Bookmarks

type Bookmarks []*gosuki.Bookmark

func (Bookmarks) UIBookmarks

func (marks Bookmarks) UIBookmarks() []*UIBookmark

type MarksContext

type MarksContext struct {
	Bookmarks []*UIBookmark
	Total     int // total number of results for query (excluding pagination)
	Pages     int
	QueryParams
}

type QueryParams

type QueryParams struct {
	Query       string
	Tag         string
	Fuzzy       bool
	NoHighlight bool
	*db.PaginationParams
}

func DefaultQueryParams

func DefaultQueryParams() QueryParams

type UIBookmark

type UIBookmark struct {
	*gosuki.Bookmark
	DisplayURL string
}

func NewUIBookmark

func NewUIBookmark(b *gosuki.Bookmark) *UIBookmark

Jump to

Keyboard shortcuts

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