gobookmarks

package module
v1.7.14 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2025 License: AGPL-3.0 Imports: 46 Imported by: 0

README

gobookmarks

logo.png

The purpose of the site is to display a list of links for you to see every time you open your browser. I have tried to move as much of the work into the app as possible with minimal effort but you will need to use GitHub occasionally.

Screenshot_20250716_161941.png

This project is a conversion of a project: goa4web-bookmarks to remove the SQL and replace it with GitHub. Which itself is extracted from goa4web, which is a Go port of a C++ site I made in 2003. Ported using ChatGPT: a4web. It's all been minimally modified and as close to the original as I could get but with the changes I required. I made modifications to this because StartHere my SPA version using modern tech failed because of GitHub OAuth2 restrictions on SPA sites. You can read more about this here: https://arranubels.substack.com/p/quicklinks

How to use

Screenshot_20250716_161715.png

  1. Sign up or log in using a database, local Git, GitHub or GitLab. On first use the service creates a repository called MyBookmarks in your account containing a bookmarks.txt file like:

    Category: Search
    http://www.google.com.au Google
    Category: Wikis
    http://en.wikipedia.org/wiki/Main_Page Wikipedia
    http://mathworld.wolfram.com/ Math World
    http://gentoo-wiki.com/Main_Page Gentoo-wiki
    

    Screenshot_20250716_162050.png

  2. Go to the URL this app is deployed at.

  3. Enjoy your new landing page / start page / bookmarks page.

File format

It's a basic file format. Every command must be on its own line; empty lines are ignored.

Code Meaning
Category[: <category>] Will create a category title. If unnamed it displays as Category.
<Link> Will create a link to <Link> with the display name <Link>
<Link> <Name> Will create a link to <Link> with the display name <Name>
Column Will create a column
Page[: <name>] Creates a new page and optionally names it
Tab[: <name>] Starts a new tab. Without a name it reverts to the main tab (switch using ?tab=<index>)
-- Inserts a horizontal rule and resets columns

Tabs contain one or more pages. The first tab is implicit and does not need a Tab directive unless you want to name it. Each Page line begins a new page within the current tab.

Example with two named columns:

Category: Left
http://left.com
Column
Category: Right
http://right.com
Big example
Tab: Home Dashboard  
Page: Quick Links  
Column  
Category: Search Engines  
https://www.google.com              Google Search  
https://duckduckgo.com              DuckDuckGo  
https://bing.com                    Bing  
https://startpage.com               Startpage  

Category: Version Control  
https://github.com                  GitHub  
https://gitlab.com                  GitLab  
https://github.com/arran4/blog      arran4 Blog  
https://github.com/arran4/dotfiles   arran4 Dotfiles  
https://bitbucket.org               Bitbucket  
https://sr.ht                       SourceHut  
https://gitea.com                   Gitea  
https://aws.amazon.com/codecommit   AWS CodeCommit  

Column  
Category: freeCodeCamp  
https://freecodecamp.org            freeCodeCamp  
https://forum.freecodecamp.org      freeCodeCamp Forum  

Category: Coursera  
https://coursera.org                Coursera  
https://blog.coursera.org           Coursera Blog  

Page: Tools  
Column  
Category: Code Editors  
https://code.visualstudio.com       Visual Studio Code  
https://sublimetext.com             Sublime Text  
https://atom.io                     Atom  
https://www.jetbrains.com/idea      IntelliJ IDEA Community Edition  

Column  
Category: Terminal Emulators  
https://wezfurlong.org/wezterm      WezTerm  
https://kitty.black                 Kitty  
https://github.com/alacritty/alacritty  Alacritty  
https://hyper.is                    Hyper  

Tab: UI Frameworks  
Page: Components  
Column  
Category: Libraries  
https://mui.com                     Material‑UI  
https://storybook.js.org            Storybook  
https://ant.design                  Ant Design  
https://chakra-ui.com               Chakra UI  

Column  
Category: Grid Guides  
https://css-tricks.com/snippets/css/complete-guide-grid   CSS‑Tricks Grid Guide  
https://getbootstrap.com/docs/5.0/layout/grid/            Bootstrap Grid Guide  
https://tailwindcss.com/docs/grid-template-columns       Tailwind CSS Grid Guide  

Page: Reference  
Column  
Category: MDN Web Docs  
https://developer.mozilla.org      MDN Web Docs  
https://caniuse.com                Can I Use  
https://www.w3.org/standards       W3C Standards  
https://devdocs.io                 DevDocs  

Tab: Entertainment  
Page: Video  
Column  
Category: Videos  
https://youtube.com                YouTube  
https://netflix.com                Netflix  
https://primevideo.com             Prime Video  

Column  
Category: Tech News  
https://news.ycombinator.com       Hacker News  
https://arstechnica.com            Ars Technica  
https://techcrunch.com             TechCrunch  

Page: Podcasts  
Column  
Category: Podcasts  
https://talkpython.fm              Talk Python To Me  
https://developerhabits.com        Developer Habits  
https://syntax.fm                  Syntax.fm  

Editing

Visual editor

There is a visual editor which you can do some things such as rearrange links, categories, pages, etc. It's designed to be for things which would be quicker to preform them that way you can also just use the text version below.

Here is a visual demonstration of the edit capabilities:

There is a distinct edit mode. With some visual indication of what can be moved:

Screenshot_20250716_162044.png

media/simplescreenrecorder-2025-07-16_16.22.12.gif

media/simplescreenrecorder-2025-07-16_16.22.19.gif

media/simplescreenrecorder-2025-07-16_16.22.27.gif

media/simplescreenrecorder-2025-07-16_16.22.51.gif

Edit as text

The /edit page allows updating the entire bookmark file. Each category heading on the index page now includes a small pencil icon link that opens /editCategory. This page shows only the selected category text and saves changes back to your bookmarks without touching other sections. Edits check the file's SHA so you'll get an error if it changed while you were editing.

Screenshot_20250716_162050.png

History

All modes have a git (or git like) means of storing history, you can see your bookmarks at any stage using this system:

Screenshot_20250716_162105.png

You can quickly search for any link on the same Tab you're on. (Tabs contain pages.)

Screenshot_20250716_162125.png

There is keyboard navigation, see keyboard shortcuts for details.

Selecting the entry from quick search focuses its input field. Press Enter inside the widget to open the search in a new tab, Shift+Enter for a background tab and hold Alt to keep the entered text.

media/simplescreenrecorder-2025-07-16_16.23.20.gif

Search Widgets

Use a link starting with the search: scheme followed by a URL containing $query, for example:

search:https://www.google.com/search?q=$query

Screencast_20250723_111959.webm.gif

Keyboard Shortcuts

The interface supports a number of keyboard shortcuts to make navigation quicker:

  • Alt+K or Ctrl+K/Cmd+K focuses the search box and selects any existing text.
  • Alt+{ and Alt+} switch between bookmark tabs.
  • Alt+[ and Alt+] switch between pages within a tab.
  • While the search box is focused, Up/Down or Left/Right arrows move between filtered results. Press Enter to open the selected link or Ctrl+Enter/Meta+Enter to open it in a background tab.
  • Pressing Esc inside the search field removes focus. Pressing Esc again clears the search and restores the previous view. Search widgets use the same pattern, with a third Esc press clearing all widget text.
  • Press ? anywhere (outside of a text field) to see these shortcuts in a small help dialog.

How to setup for yourself

You can run this yourself. Docker images are published to the GitHub Container Registry as ghcr.io/arran4/gobookmarks. There are also precompiled versions under the releases section of this git repo: https://github.com/arran4/gobookmarks/releases

Configuration values can be supplied as environment variables, via a JSON configuration file or using command line arguments. Environment variables are the lowest priority, followed by the configuration file and finally command line arguments. If /etc/gobookmarks/gobookmarks.env exists it will be loaded before reading the environment.

Name Description
GITHUB_CLIENT_ID GitHub OAuth2 client ID
GITHUB_SECRET GitHub OAuth2 client secret
GITLAB_CLIENT_ID GitLab OAuth2 client ID
GITLAB_SECRET GitLab OAuth2 client secret
EXTERNAL_URL Fully qualified URL the service is reachable on, e.g. http://localhost:8080
GBM_CSS_COLUMNS If set (to any value) the Column keyword in your bookmarks is rendered using a flex-based layout that emulates table positioning.
GBM_NAMESPACE Optional suffix added to the bookmarks repository name.
GBM_TITLE Overrides the page title shown in the browser.
GBM_NO_FOOTER Hide footer on pages.
GBM_DEV_MODE Enable developer helpers like /_css and /_table. Defaults to on when built as dev.
FAVICON_CACHE_DIR Directory where fetched favicons are stored. If unset icons are kept only in memory. Defaults to /var/cache/gobookmarks/favcache when installed system‑wide (including the Docker image).
FAVICON_CACHE_SIZE Maximum size in bytes of the favicon cache before old icons are removed. Defaults to 20971520.
GITHUB_SERVER Base URL for GitHub (set for GitHub Enterprise).
GITLAB_SERVER Base URL for GitLab (self-hosted).
LOCAL_GIT_PATH Directory used for the local git provider. Defaults to /var/lib/gobookmarks/localgit when installed system‑wide (including the Docker image).
DB_CONNECTION_PROVIDER SQL driver name for the SQL provider. mysql or sqlite3
DB_CONNECTION_STRING Connection string for the SQL provider. File path for sqlite3 or user:pass@/database?multiStatements=true See https://github.com/go-sql-driver/mysql
GBM_NO_FOOTER Hide the footer on pages.
SESSION_KEY Secret used to sign session cookies. If unset the program reads or creates session.key under $XDG_STATE_HOME/gobookmarks, $HOME/.local/state/gobookmarks or /var/lib/gobookmarks.
PROVIDER_ORDER Comma-separated list controlling the order login options are shown. Unrecognized names are ignored. Defaults to alphabetical order.
GOBM_ENV_FILE Path to a file of KEY=VALUE pairs loaded before the environment. Defaults to /etc/gobookmarks/gobookmarks.env.
GOBM_CONFIG_FILE Path to the JSON config file. If unset the program uses $XDG_CONFIG_HOME/gobookmarks/config.json or $HOME/.config/gobookmarks/config.json for normal users and /etc/gobookmarks/config.json when installed system‑wide or run as root.

Favicons fetched for your bookmarks are cached on disk when FAVICON_CACHE_DIR is set. The /proxy/favicon endpoint also accepts a size parameter to scale icons on the fly.

You can place these settings in /etc/gobookmarks/gobookmarks.env as KEY=VALUE pairs and the service will load them automatically if the file exists. The release packages do not install this file; create it manually if you want to use environment-based settings.

Use --config <path> or set GOBM_CONFIG_FILE to control which configuration file is loaded.

The --title flag or GBM_TITLE environment variable sets the browser page title. The --no-footer flag or GBM_NO_FOOTER environment variable hides the footer on pages. The --dev-mode flag or GBM_DEV_MODE environment variable toggles the developer helpers. Use --github-server or GITHUB_SERVER to override the GitHub base URL and --gitlab-server or GITLAB_SERVER for GitLab. Use --no-footer or GBM_NO_FOOTER to hide the footer on pages. Use --provider-order or PROVIDER_ORDER to customize the login button order.

Running gobookmarks --version will print the version information along with the list of compiled-in providers. When no OAuth2 credentials are configured the login buttons are hidden. Visit /status to see which providers are available. Use --dump-config to print the final configuration after merging the environment, config file and command line arguments.

OAuth2 setup

For GitHub visit https://github.com/settings/developers. For GitLab visit https://gitlab.com/-/profile/applications.

Create an application, call it whatever you like. Set the Callback URL to whatever you put in EXTERNAL_URL and add: /oauth2Callback to the end, ie if you entered: http://localhost:8080 it should be: http://localhost:8080/oauth2Callback

Upload logo.png for the logo.

Generate a secret key and use it for the environment variables with the Client Id.

Running as a Service

The release packages include service files for both systemd and FreeBSD rc.d. During installation these files can be copied to your system so the server starts automatically on boot.

When installed from the release packages the service files pass --config /etc/gobookmarks/config.json. An example config file is included in the packages and is installed with permissions 0600 owned by the gobookmarks user. The installation process creates this user automatically and both service files run the daemon as gobookmarks.

Docker

The Docker image continues to work as before and now uses an Alpine base image. Mount /var/cache/gobookmarks if you need persistent storage for favicons and /var/lib/gobookmarks for the git provider. These directories are also the defaults when gobookmarks is installed system-wide under /usr. Pass the same environment variables as listed above. The git provider stores data under $LOCAL_GIT_PATH/<sha256(username)>/ as a git repository with a .password file containing the bcrypt hash. Create an account via /signup/git. This stores the password hash under $LOCAL_GIT_PATH/<sha256(username)>/.password and creates the repository. Log in later via /login/git using the same credentials. Passwords can be updated with the provider's SetPassword method.

To locate the file, compute the SHA-256 of your username and look for the corresponding directory. For example:

echo -n alice | sha256sum

The output hash forms the path $LOCAL_GIT_PATH/<hash>/.password. Favicons are cached on disk under /var/cache/gobookmarks/favcache by default when the program is installed system‑wide or run in Docker. Set FAVICON_CACHE_DIR to an empty string to disable disk caching. The optional SQL provider stores bookmarks and passwords in a database when DB_CONNECTION_PROVIDER and DB_CONNECTION_STRING are set. Accounts are created through /signup/sql and log in via /login/sql. Only the latest bookmarks are returned; commit history is maintained in the history table.

Legacy migration

The sql/legacy_migrate.sql file contains SQL statements that convert the original goa4web-bookmarks tables into the schema used here. Execute the script manually on your database before enabling the SQL provider. You can run the container entirely via environment variables:

docker run -p 8080:8080 \
           -v /my/cache:/var/cache/gobookmarks \
           -v /my/db:/var/lib/gobookmarks \
           -e EXTERNAL_URL=http://localhost:8080 \
           -e GITHUB_CLIENT_ID=abc \
           -e GITHUB_SECRET=def \
           -e FAVICON_CACHE_DIR=/var/cache/gobookmarks/favcache \
           -e LOCAL_GIT_PATH=/var/lib/gobookmarks/localgit \
           -e DB_CONNECTION_PROVIDER=sqlite3 \
           -e DB_CONNECTION_STRING=/var/lib/gobookmarks/bookmarks.db \
           ghcr.io/arran4/gobookmarks

Alternatively you can mount a config file and environment file:

docker run -v /my/config.json:/etc/gobookmarks/config.json \
           -v /my/gobookmarks.env:/etc/gobookmarks/gobookmarks.env \
           -v /my/cache:/var/cache/gobookmarks \
           -v /my/db:/var/lib/gobookmarks \
           -p 8080:8080 ghcr.io/arran4/gobookmarks

An example config.json looks like:

{
  "github_client_id": "",
  "github_secret": "",
  "gitlab_client_id": "",
  "gitlab_secret": "",
  "external_url": "http://localhost:8080",
  "css_columns": false,
  "namespace": "",
  "title": "",
  "no_footer": false,
  "github_server": "https://github.com",
  "gitlab_server": "https://gitlab.com",
  "favicon_cache_dir": "/var/cache/gobookmarks/favcache",
  "favicon_cache_size": 20971520,
  "local_git_path": "/var/lib/gobookmarks/localgit",
  "db_connection_provider": "sqlite3",
  "db_connection_string": "/var/lib/gobookmarks/bookmarks.db",
  "no_footer": false
}
Docker Compose

Using environment variables:

version: '3'
services:
  gobookmarks:
    image: ghcr.io/arran4/gobookmarks
    ports:
      - "8080:8080"
    volumes:
      - cache:/var/cache/gobookmarks
      - db:/var/lib/gobookmarks
    environment:
      EXTERNAL_URL: "http://localhost:8080"
      GITHUB_CLIENT_ID: abc
      GITHUB_SECRET: def
      FAVICON_CACHE_DIR: /var/cache/gobookmarks/favcache
      LOCAL_GIT_PATH: /var/lib/gobookmarks/localgit
      DB_CONNECTION_PROVIDER: sqlite3
      DB_CONNECTION_STRING: /var/lib/gobookmarks/bookmarks.db
volumes:
  cache:
  db:

Using a config and env file:

version: '3'
services:
  gobookmarks:
    image: ghcr.io/arran4/gobookmarks
    ports:
      - "8080:8080"
    volumes:
      - ./config.json:/etc/gobookmarks/config.json:ro
      - ./gobookmarks.env:/etc/gobookmarks/gobookmarks.env:ro
      - cache:/var/cache/gobookmarks
      - db:/var/lib/gobookmarks
volumes:
  cache:
  db:

Documentation

Index

Constants

View Source
const (
	DefaultFaviconCacheSize   int64         = 20 * 1024 * 1024 // 20MB
	DefaultFaviconCacheMaxAge time.Duration = 24 * time.Hour
	DefaultCommitsPerPage     int           = 100
)

Variables

View Source
var (
	SessionStore sessions.Store
	SessionName  string
)
View Source
var (
	UseCssColumns bool
	DevMode       bool
	Namespace     string
	SiteTitle     string
	NoFooter      bool

	GithubServer string
	GitlabServer string

	GithubClientID     string
	GithubClientSecret string
	GitlabClientID     string
	GitlabClientSecret string

	OauthRedirectURL string
	FaviconCacheDir  string
	FaviconCacheSize int64

	LocalGitPath string

	DBConnectionProvider string
	DBConnectionString   string

	CommitsPerPage int
)
View Source
var ErrHandled = errors.New("handled")

ErrHandled is returned by handlers when they have already written a response and no further handlers should run.

View Source
var ErrNoProvider = errors.New("no provider selected")

ErrNoProvider indicates that no provider was selected for the request.

View Source
var ErrRepoNotFound = errors.New("repository not found")

ErrRepoNotFound indicates that the bookmarks repository does not exist.

View Source
var ErrSignedOut = errors.New("signed out")

ErrSignedOut indicates that the OAuth token is no longer valid and the user must authenticate again.

View Source
var ErrUserExists = errors.New("user already exists")

ErrUserExists indicates that a user already exists when attempting signup.

View Source
var ErrUserNotFound = errors.New("user not found")

ErrUserNotFound indicates that a user does not exist when attempting to set a password.

View Source
var (
	FaviconCache = struct {
		sync.RWMutex
		cache map[string]*FavIcon
	}{/* contains filtered or unexported fields */}
)

Functions

func AddCategoryPage added in v1.4.0

func AddCategoryPage(w http.ResponseWriter, r *http.Request) error

func AppendTab added in v1.0.24

func AppendTab(bookmarks, name, text string) string

AppendTab appends a new tab with name and text to bookmarks.

func BP added in v1.0.2

func BP(b bool) *bool

func Bookmarks

func Bookmarks(r *http.Request) (string, error)

func BookmarksEditCreateAction

func BookmarksEditCreateAction(w http.ResponseWriter, r *http.Request) error

func BookmarksEditSaveAction

func BookmarksEditSaveAction(w http.ResponseWriter, r *http.Request) error

func BookmarksExist added in v1.0.23

func BookmarksExist(r *http.Request) (bool, error)

func CategoryAddSaveAction added in v1.4.0

func CategoryAddSaveAction(w http.ResponseWriter, r *http.Request) error

func CategoryEditSaveAction added in v1.0.16

func CategoryEditSaveAction(w http.ResponseWriter, r *http.Request) error

func CategoryMoveBeforeAction added in v1.3.0

func CategoryMoveBeforeAction(w http.ResponseWriter, r *http.Request) error

func CategoryMoveEndAction added in v1.3.0

func CategoryMoveEndAction(w http.ResponseWriter, r *http.Request) error

func CategoryMoveNewColumnAction added in v1.3.0

func CategoryMoveNewColumnAction(w http.ResponseWriter, r *http.Request) error

func ConfiguredProviderNames added in v1.3.0

func ConfiguredProviderNames() []string

ConfiguredProviderNames returns the list of providers that are both compiled in and configured for use. A provider is considered configured when providerCreds returns non-nil.

func CoreAdderMiddleware

func CoreAdderMiddleware(next http.Handler) http.Handler

func CreateBookmarks

func CreateBookmarks(ctx context.Context, user string, token *oauth2.Token, branch, text string) error

func DefaultConfigPath added in v1.0.22

func DefaultConfigPath() string

DefaultConfigPath returns the path to the config file depending on environment and the effective user. If running as a non-root user and XDG variables are set, the config lives under the XDG config directory. Otherwise it falls back to /etc/gobookmarks/config.json.

func DefaultSessionKeyPath added in v1.3.0

func DefaultSessionKeyPath(writing bool) string

DefaultSessionKeyPath returns the location of the session key file. User installs store it under XDG state or ~/.local/state. System-wide installations use /var/lib/gobookmarks/session.key. DefaultSessionKeyPath returns the path used to read or write the session key depending on the value of writing. When writing it chooses the path appropriate for the current user. When reading it checks the usual locations and returns the first existing file, falling back to the writing location if none are found.

func DisableCssColumnsAction added in v1.4.0

func DisableCssColumnsAction(w http.ResponseWriter, r *http.Request) error

DisableCssColumnsAction stores a session flag to use table layout.

func EditCategoryPage added in v1.0.16

func EditCategoryPage(w http.ResponseWriter, r *http.Request) error

func EditPagePage added in v1.3.0

func EditPagePage(w http.ResponseWriter, r *http.Request) error

func EditTabPage added in v1.0.24

func EditTabPage(w http.ResponseWriter, r *http.Request) error

func EnableCssColumnsAction added in v1.4.0

func EnableCssColumnsAction(w http.ResponseWriter, r *http.Request) error

EnableCssColumnsAction stores a session flag to use CSS column layout.

func ExtractCategoryByIndex added in v1.0.16

func ExtractCategoryByIndex(bookmarks string, index int) (string, error)

ExtractCategoryByIndex returns the category text for the nth category (0 based)

func ExtractTab added in v1.0.24

func ExtractTab(bookmarks, name string) (string, error)

ExtractTab returns the text for a tab by name including the 'Tab:' line.

func FaviconProxyHandler added in v1.0.4

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

func GetAdjacentCommits added in v1.5.2

func GetAdjacentCommits(ctx context.Context, user string, token *oauth2.Token, ref, sha string) (string, string, error)

func GetBookmarks

func GetBookmarks(ctx context.Context, user, ref string, token *oauth2.Token) (string, string, error)

func GetBookmarksRepoName added in v1.0.2

func GetBookmarksRepoName() string

GetBookmarksRepoName returns the repository name based on the current configuration and build mode. When running a development build the name is suffixed with "-dev". The Namespace value is appended if supplied.

func GetCompiledTemplates

func GetCompiledTemplates(funcs template.FuncMap) *template.Template

func GetFavicon

func GetFavicon() []byte

func GetMainCSSData

func GetMainCSSData() []byte

func GitLoginAction added in v1.0.24

func GitLoginAction(w http.ResponseWriter, r *http.Request) error

func GitSignupAction added in v1.0.24

func GitSignupAction(w http.ResponseWriter, r *http.Request) error

func JoinURL added in v1.0.26

func JoinURL(base, elem string) string

JoinURL joins base and elem ensuring there is exactly one slash between them. Additional leading or trailing slashes are removed from elem.

func LoadEnvFile added in v1.0.22

func LoadEnvFile(path string) error

Lines should be in KEY=VALUE format and may be commented with '#'.

func LoginWithProvider added in v1.0.24

func LoginWithProvider(w http.ResponseWriter, r *http.Request) error

func MergeConfig added in v1.0.22

func MergeConfig(dst *Config, src Config)

MergeConfig copies values from src into dst if they are non-zero.

func MoveEntryAction added in v1.3.0

func MoveEntryAction(w http.ResponseWriter, r *http.Request) error

func MovePageAction added in v1.3.0

func MovePageAction(w http.ResponseWriter, r *http.Request) error

func MoveTabAction added in v1.3.0

func MoveTabAction(w http.ResponseWriter, r *http.Request) error

func NewFuncs

func NewFuncs(r *http.Request) template.FuncMap

func NewSystemError added in v1.5.3

func NewSystemError(msg string, err error) error

NewSystemError creates a SystemError with the provided display message and underlying cause.

func NewUserError added in v1.5.3

func NewUserError(msg string, err error) error

NewUserError creates a UserError with the provided display message and underlying cause.

func Oauth2CallbackPage

func Oauth2CallbackPage(w http.ResponseWriter, r *http.Request) error

func PageEditSaveAction added in v1.3.0

func PageEditSaveAction(w http.ResponseWriter, r *http.Request) error

func ProviderNames added in v1.0.22

func ProviderNames() []string

ProviderNames returns the list of registered provider names in the order set by SetProviderOrder. The returned slice should not be modified.

func RegisterProvider added in v1.0.22

func RegisterProvider(p Provider)

RegisterProvider registers a Provider by name. The order providers are registered is tracked but the final ordering returned by ProviderNames may be modified via SetProviderOrder.

func ReplaceCategoryByIndex added in v1.0.16

func ReplaceCategoryByIndex(bookmarks string, index int, newText string) (string, error)

ReplaceCategoryByIndex replaces the nth category with newText

func ReplaceTab added in v1.0.24

func ReplaceTab(bookmarks, name, newName, newText string) (string, error)

ReplaceTab replaces the tab with name with newName and newText. newText should not include the leading 'Tab:' line.

func SP

func SP(s string) *string

func SetProviderOrder added in v1.5.1

func SetProviderOrder(order []string)

SetProviderOrder updates the order in which providers are returned by ProviderNames. Names not recognized are ignored. Any registered providers not mentioned remain at the end in alphabetical order.

func SetVersion added in v1.0.6

func SetVersion(pVersion, pCommit, pDate string)

func SqlLoginAction added in v1.5.0

func SqlLoginAction(w http.ResponseWriter, r *http.Request) error

func SqlSignupAction added in v1.5.0

func SqlSignupAction(w http.ResponseWriter, r *http.Request) error

func StartEditMode added in v1.3.0

func StartEditMode(w http.ResponseWriter, r *http.Request) error

StartEditMode enables edit mode by adding an "edit=1" query parameter.

func StopEditMode added in v1.3.0

func StopEditMode(w http.ResponseWriter, r *http.Request) error

StopEditMode disables edit mode by removing the "edit" query parameter.

func TabEditSaveAction added in v1.0.24

func TabEditSaveAction(w http.ResponseWriter, r *http.Request) error

func TaskDoneAutoRefreshPage

func TaskDoneAutoRefreshPage(w http.ResponseWriter, r *http.Request) error

func UpdateBookmarks

func UpdateBookmarks(ctx context.Context, user string, token *oauth2.Token, sourceRef, branch, text, expectSHA string) error

func UserAdderMiddleware

func UserAdderMiddleware(next http.Handler) http.Handler

func UserLogoutAction

func UserLogoutAction(w http.ResponseWriter, r *http.Request) error

Types

type AdjacentCommitProvider added in v1.5.2

type AdjacentCommitProvider interface {
	AdjacentCommits(ctx context.Context, user string, token *oauth2.Token, ref, sha string) (string, string, error)
}

AdjacentCommitProvider optionally provides methods to navigate commit history.

type BookmarkBlock added in v1.0.15

type BookmarkBlock struct {
	Columns []*BookmarkColumn
	HR      bool
}

BookmarkBlock groups columns and optional horizontal rule.

func (*BookmarkBlock) Sha added in v1.3.0

func (b *BookmarkBlock) Sha() string

func (*BookmarkBlock) String added in v1.3.0

func (b *BookmarkBlock) String() string

String serializes the block.

type BookmarkCategory

type BookmarkCategory struct {
	Name    string
	Entries []*BookmarkEntry
	Index   int
}

BookmarkCategory groups entries together.

func (*BookmarkCategory) DisplayName added in v1.3.0

func (c *BookmarkCategory) DisplayName() string

DisplayName returns a useful name for the category.

func (*BookmarkCategory) MoveEntry added in v1.3.0

func (c *BookmarkCategory) MoveEntry(i, j int)

MoveEntry moves an entry within the category from index i to j.

func (*BookmarkCategory) Sha added in v1.3.0

func (c *BookmarkCategory) Sha() string

func (*BookmarkCategory) String added in v1.3.0

func (c *BookmarkCategory) String() string

String serializes the category.

type BookmarkColumn

type BookmarkColumn struct {
	Categories []*BookmarkCategory
}

BookmarkColumn contains a list of categories.

func (*BookmarkColumn) AddCategory added in v1.3.0

func (c *BookmarkColumn) AddCategory(cat *BookmarkCategory)

AddCategory appends a category to the column.

func (*BookmarkColumn) InsertCategory added in v1.3.0

func (c *BookmarkColumn) InsertCategory(idx int, cat *BookmarkCategory)

InsertCategory inserts a category at the given index.

func (*BookmarkColumn) Sha added in v1.3.0

func (c *BookmarkColumn) Sha() string

func (*BookmarkColumn) String added in v1.3.0

func (c *BookmarkColumn) String() string

String serializes the column.

func (*BookmarkColumn) SwitchCategories added in v1.3.0

func (c *BookmarkColumn) SwitchCategories(i, j int)

SwitchCategories swaps two categories in the column.

type BookmarkEntry

type BookmarkEntry struct {
	Url  string
	Name string
}

BookmarkEntry represents a single link.

func (*BookmarkEntry) DisplayName added in v1.3.0

func (e *BookmarkEntry) DisplayName() string

DisplayName returns a useful name for the entry.

func (*BookmarkEntry) Sha added in v1.3.0

func (e *BookmarkEntry) Sha() string

func (*BookmarkEntry) String added in v1.3.0

func (e *BookmarkEntry) String() string

String serializes the entry.

type BookmarkList added in v1.3.0

type BookmarkList []*BookmarkTab

Bookmarks is a collection of tabs.

func ParseBookmarks added in v1.3.0

func ParseBookmarks(bookmarks string) BookmarkList

ParseBookmarks converts the textual bookmark representation into a BookmarkList structure.

func (*BookmarkList) AddTab added in v1.3.0

func (b *BookmarkList) AddTab(t *BookmarkTab)

AddTab appends a tab to the list.

func (*BookmarkList) InsertTab added in v1.3.0

func (b *BookmarkList) InsertTab(idx int, t *BookmarkTab)

InsertTab inserts a tab at the given index.

func (BookmarkList) MoveCategory added in v1.3.0

func (tabs BookmarkList) MoveCategory(fromIndex, toIndex int, newColumn bool, destPage *BookmarkPage, destCol int) error

MoveCategory moves the category at fromIndex so it appears before toIndex. If toIndex equals the total number of categories, the item is moved to the end. When newColumn is true a new column directive is inserted before the moved category.

func (BookmarkList) MoveCategoryBefore added in v1.3.0

func (tabs BookmarkList) MoveCategoryBefore(fromIndex, beforeIndex int) error

MoveCategoryBefore moves the category at fromIndex so it appears before beforeIndex.

func (BookmarkList) MoveCategoryNewColumn added in v1.3.0

func (tabs BookmarkList) MoveCategoryNewColumn(fromIndex int, page *BookmarkPage, destCol int) error

MoveCategoryNewColumn moves the category into a new column inserted after the specified column index on the given page. When page is nil the category is moved to a new column on the last page. If destCol is negative the column is appended to the end of the page.

func (BookmarkList) MoveCategoryToEnd added in v1.3.0

func (tabs BookmarkList) MoveCategoryToEnd(fromIndex int, page *BookmarkPage, colIdx int) error

MoveCategoryToEnd moves the category to the end of the specified column.

func (BookmarkList) MoveTab added in v1.3.0

func (b BookmarkList) MoveTab(i, j int)

MoveTab moves a tab from index i to j in the list.

func (BookmarkList) Sha added in v1.3.0

func (b BookmarkList) Sha() string

func (BookmarkList) String added in v1.3.0

func (b BookmarkList) String() string

String serializes the bookmark list back into textual form.

func (BookmarkList) SwitchTabs added in v1.3.0

func (b BookmarkList) SwitchTabs(i, j int)

SwitchTabs swaps two tabs in the list.

type BookmarkPage added in v1.0.15

type BookmarkPage struct {
	Blocks []*BookmarkBlock
	Name   string
}

BookmarkPage contains a number of blocks.

func FindPageBySha added in v1.3.0

func FindPageBySha(tabs BookmarkList, sha string) *BookmarkPage

FindPageBySha returns the page matching the sha.

func PageForCategory added in v1.3.0

func PageForCategory(tabs BookmarkList, index int) *BookmarkPage

PageForCategory returns the page containing the category with the given index.

func (*BookmarkPage) DisplayName added in v1.3.0

func (p *BookmarkPage) DisplayName() string

DisplayName returns a useful name for the page.

func (*BookmarkPage) IndexName added in v1.3.0

func (p *BookmarkPage) IndexName() string

IndexName returns a name suitable for the navigation index.

func (*BookmarkPage) IsEmpty added in v1.4.0

func (p *BookmarkPage) IsEmpty() bool

IsEmpty returns true if the page contains no categories.

func (*BookmarkPage) Sha added in v1.3.0

func (p *BookmarkPage) Sha() string

func (*BookmarkPage) String added in v1.3.0

func (p *BookmarkPage) String() string

String serializes the page (excluding the Page line).

type BookmarkTab added in v1.3.0

type BookmarkTab struct {
	Name  string
	Pages []*BookmarkPage
}

BookmarkTab represents a tab of pages.

func (*BookmarkTab) AddPage added in v1.3.0

func (t *BookmarkTab) AddPage(p *BookmarkPage)

AddPage appends a page to the tab.

func (*BookmarkTab) DisplayName added in v1.3.0

func (t *BookmarkTab) DisplayName() string

DisplayName returns a useful name for the tab.

func (*BookmarkTab) IndexName added in v1.3.0

func (t *BookmarkTab) IndexName() string

IndexName returns a name suitable for the navigation index.

func (*BookmarkTab) InsertPage added in v1.3.0

func (t *BookmarkTab) InsertPage(idx int, p *BookmarkPage)

InsertPage inserts a page at the given index.

func (*BookmarkTab) MovePage added in v1.3.0

func (t *BookmarkTab) MovePage(i, j int)

MovePage moves a page from index i to j within the tab.

func (*BookmarkTab) Sha added in v1.3.0

func (t *BookmarkTab) Sha() string

func (*BookmarkTab) String added in v1.3.0

func (t *BookmarkTab) String() string

String serializes the tab including Tab/Page directives.

func (*BookmarkTab) SwitchPages added in v1.3.0

func (t *BookmarkTab) SwitchPages(i, j int)

SwitchPages swaps two pages within the tab.

type Branch added in v1.0.22

type Branch struct {
	Name string
}

func GetBranches

func GetBranches(ctx context.Context, user string, token *oauth2.Token) ([]*Branch, error)

type Commit added in v1.0.22

type Commit struct {
	SHA            string
	Message        string
	CommitterName  string
	CommitterEmail string
	CommitterDate  time.Time
}

func GetCommits

func GetCommits(ctx context.Context, user string, token *oauth2.Token, ref string, page, perPage int) ([]*Commit, error)

type Config added in v1.0.22

type Config struct {
	GithubClientID       string   `json:"github_client_id"`
	GithubSecret         string   `json:"github_secret"`
	GitlabClientID       string   `json:"gitlab_client_id"`
	GitlabSecret         string   `json:"gitlab_secret"`
	ExternalURL          string   `json:"external_url"`
	CssColumns           bool     `json:"css_columns"`
	DevMode              *bool    `json:"dev_mode"`
	Namespace            string   `json:"namespace"`
	Title                string   `json:"title"`
	GithubServer         string   `json:"github_server"`
	GitlabServer         string   `json:"gitlab_server"`
	FaviconCacheDir      string   `json:"favicon_cache_dir"`
	FaviconCacheSize     int64    `json:"favicon_cache_size"`
	LocalGitPath         string   `json:"local_git_path"`
	NoFooter             bool     `json:"no_footer"`
	SessionKey           string   `json:"session_key"`
	DBConnectionProvider string   `json:"db_connection_provider"`
	DBConnectionString   string   `json:"db_connection_string"`
	ProviderOrder        []string `json:"provider_order"`
	CommitsPerPage       int      `json:"commits_per_page"`
}

Config holds runtime configuration values.

func LoadConfigFile added in v1.0.22

func LoadConfigFile(path string) (Config, bool, error)

LoadConfigFile loads configuration from the given path. It returns the loaded Config, a boolean indicating if the file existed, and any error that occurred while reading or parsing the file.

type Configuration

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

func NewConfiguration

func NewConfiguration() *Configuration

TODO use for settings

type ContextValues

type ContextValues string

type CoreData

type CoreData struct {
	Title       string
	AutoRefresh bool
	UserRef     string
	EditMode    bool
}

type FavIcon added in v1.0.9

type FavIcon struct {
	Data        []byte
	ContentType string
}

type GitHubProvider added in v1.0.22

type GitHubProvider struct{}

GitHubProvider implements Provider for GitHub.

func (GitHubProvider) Config added in v1.0.24

func (GitHubProvider) Config(clientID, clientSecret, redirectURL string) *oauth2.Config

func (GitHubProvider) CreateBookmarks added in v1.0.22

func (p GitHubProvider) CreateBookmarks(ctx context.Context, user string, token *oauth2.Token, branch, text string) error

func (GitHubProvider) CreateRepo added in v1.0.23

func (p GitHubProvider) CreateRepo(ctx context.Context, user string, token *oauth2.Token, name string) error

func (GitHubProvider) CurrentUser added in v1.0.22

func (p GitHubProvider) CurrentUser(ctx context.Context, token *oauth2.Token) (*User, error)

func (GitHubProvider) DefaultServer added in v1.0.23

func (GitHubProvider) DefaultServer() string

func (GitHubProvider) GetBookmarks added in v1.0.22

func (p GitHubProvider) GetBookmarks(ctx context.Context, user, ref string, token *oauth2.Token) (string, string, error)

func (GitHubProvider) GetBranches added in v1.0.22

func (p GitHubProvider) GetBranches(ctx context.Context, user string, token *oauth2.Token) ([]*Branch, error)

func (GitHubProvider) GetCommits added in v1.0.22

func (p GitHubProvider) GetCommits(ctx context.Context, user string, token *oauth2.Token, ref string, page, perPage int) ([]*Commit, error)

func (GitHubProvider) GetTags added in v1.0.22

func (p GitHubProvider) GetTags(ctx context.Context, user string, token *oauth2.Token) ([]*Tag, error)

func (GitHubProvider) Name added in v1.0.22

func (GitHubProvider) Name() string

func (GitHubProvider) RepoExists added in v1.0.24

func (p GitHubProvider) RepoExists(ctx context.Context, user string, token *oauth2.Token, name string) (bool, error)

func (GitHubProvider) UpdateBookmarks added in v1.0.22

func (p GitHubProvider) UpdateBookmarks(ctx context.Context, user string, token *oauth2.Token, sourceRef, branch, text, expectSHA string) error

type GitLabProvider added in v1.0.22

type GitLabProvider struct{}

GitLabProvider implements Provider for GitLab.

The GitLab server URL can be overridden using the GitlabServer variable defined in settings.go.

func (GitLabProvider) Config added in v1.0.24

func (GitLabProvider) Config(clientID, clientSecret, redirectURL string) *oauth2.Config

func (GitLabProvider) CreateBookmarks added in v1.0.22

func (GitLabProvider) CreateBookmarks(ctx context.Context, user string, token *oauth2.Token, branch, text string) error

func (GitLabProvider) CreateRepo added in v1.0.23

func (p GitLabProvider) CreateRepo(ctx context.Context, user string, token *oauth2.Token, name string) error

func (GitLabProvider) CurrentUser added in v1.0.22

func (GitLabProvider) CurrentUser(ctx context.Context, token *oauth2.Token) (*User, error)

func (GitLabProvider) DefaultServer added in v1.0.23

func (GitLabProvider) DefaultServer() string

func (GitLabProvider) GetBookmarks added in v1.0.22

func (GitLabProvider) GetBookmarks(ctx context.Context, user, ref string, token *oauth2.Token) (string, string, error)

func (GitLabProvider) GetBranches added in v1.0.22

func (GitLabProvider) GetBranches(ctx context.Context, user string, token *oauth2.Token) ([]*Branch, error)

func (GitLabProvider) GetCommits added in v1.0.22

func (GitLabProvider) GetCommits(ctx context.Context, user string, token *oauth2.Token, ref string, page, perPage int) ([]*Commit, error)

func (GitLabProvider) GetTags added in v1.0.22

func (GitLabProvider) GetTags(ctx context.Context, user string, token *oauth2.Token) ([]*Tag, error)

func (GitLabProvider) Name added in v1.0.22

func (GitLabProvider) Name() string

func (GitLabProvider) RepoExists added in v1.0.24

func (p GitLabProvider) RepoExists(ctx context.Context, user string, token *oauth2.Token, name string) (bool, error)

func (GitLabProvider) UpdateBookmarks added in v1.0.22

func (GitLabProvider) UpdateBookmarks(ctx context.Context, user string, token *oauth2.Token, sourceRef, branch, text, expectSHA string) error

type GitProvider added in v1.0.24

type GitProvider struct{}

GitProvider implements Provider using local git repositories.

func (GitProvider) AdjacentCommits added in v1.5.2

func (GitProvider) AdjacentCommits(ctx context.Context, user string, token *oauth2.Token, ref, sha string) (string, string, error)

func (GitProvider) CheckPassword added in v1.0.24

func (GitProvider) CheckPassword(ctx context.Context, user, password string) (bool, error)

CheckPassword verifies the provided password against the stored bcrypt hash.

func (GitProvider) Config added in v1.0.24

func (GitProvider) Config(clientID, clientSecret, redirectURL string) *oauth2.Config

func (GitProvider) CreateBookmarks added in v1.0.24

func (GitProvider) CreateBookmarks(ctx context.Context, user string, token *oauth2.Token, branch, text string) error

func (GitProvider) CreateRepo added in v1.0.24

func (GitProvider) CreateRepo(ctx context.Context, user string, token *oauth2.Token, name string) error

func (GitProvider) CreateUser added in v1.0.24

func (GitProvider) CreateUser(ctx context.Context, user, password string) error

CreateUser writes a bcrypt hash for the given user. It returns ErrUserExists if the password file already exists.

func (GitProvider) CurrentUser added in v1.0.24

func (GitProvider) CurrentUser(ctx context.Context, token *oauth2.Token) (*User, error)

func (GitProvider) DefaultServer added in v1.0.24

func (GitProvider) DefaultServer() string

func (GitProvider) GetBookmarks added in v1.0.24

func (GitProvider) GetBookmarks(ctx context.Context, user, ref string, token *oauth2.Token) (string, string, error)

func (GitProvider) GetBranches added in v1.0.24

func (GitProvider) GetBranches(ctx context.Context, user string, token *oauth2.Token) ([]*Branch, error)

func (GitProvider) GetCommits added in v1.0.24

func (GitProvider) GetCommits(ctx context.Context, user string, token *oauth2.Token, ref string, page, perPage int) ([]*Commit, error)

func (GitProvider) GetTags added in v1.0.24

func (GitProvider) GetTags(ctx context.Context, user string, token *oauth2.Token) ([]*Tag, error)

func (GitProvider) Name added in v1.0.24

func (GitProvider) Name() string

func (GitProvider) RepoExists added in v1.0.24

func (GitProvider) RepoExists(ctx context.Context, user string, token *oauth2.Token, name string) (bool, error)

func (GitProvider) SetPassword added in v1.0.24

func (GitProvider) SetPassword(ctx context.Context, user, password string) error

SetPassword updates the password for an existing user. ErrUserNotFound is returned when no password file exists.

func (GitProvider) UpdateBookmarks added in v1.0.24

func (GitProvider) UpdateBookmarks(ctx context.Context, user string, token *oauth2.Token, sourceRef, branch, text, expectSHA string) error

type PasswordHandler added in v1.0.24

type PasswordHandler interface {
	CreateUser(ctx context.Context, user, password string) error
	SetPassword(ctx context.Context, user, password string) error
	CheckPassword(ctx context.Context, user, password string) (bool, error)
}

PasswordHandler is implemented by providers that manage passwords. PasswordHandler manages user accounts for providers that do not rely on external authentication.

CreateUser registers a new account and returns ErrUserExists if the user is already present. SetPassword updates the password for an existing user and returns ErrUserNotFound when the account does not exist.

type Provider added in v1.0.22

type Provider interface {
	Name() string
	Config(clientID, clientSecret, redirectURL string) *oauth2.Config
	CurrentUser(ctx context.Context, token *oauth2.Token) (*User, error)
	GetTags(ctx context.Context, user string, token *oauth2.Token) ([]*Tag, error)
	GetBranches(ctx context.Context, user string, token *oauth2.Token) ([]*Branch, error)
	GetCommits(ctx context.Context, user string, token *oauth2.Token, ref string, page, perPage int) ([]*Commit, error)
	GetBookmarks(ctx context.Context, user, ref string, token *oauth2.Token) (string, string, error)
	UpdateBookmarks(ctx context.Context, user string, token *oauth2.Token, sourceRef, branch, text, expectSHA string) error
	CreateBookmarks(ctx context.Context, user string, token *oauth2.Token, branch, text string) error
	CreateRepo(ctx context.Context, user string, token *oauth2.Token, name string) error
	RepoExists(ctx context.Context, user string, token *oauth2.Token, name string) (bool, error)
	DefaultServer() string
}

func GetProvider added in v1.0.22

func GetProvider(name string) Provider

type ProviderCreds added in v1.0.24

type ProviderCreds struct {
	ID     string
	Secret string
}

type SQLProvider added in v1.5.0

type SQLProvider struct{}

func (SQLProvider) AdjacentCommits added in v1.5.2

func (p SQLProvider) AdjacentCommits(ctx context.Context, user string, token *oauth2.Token, ref, sha string) (string, string, error)

func (SQLProvider) CheckPassword added in v1.5.0

func (p SQLProvider) CheckPassword(ctx context.Context, user, password string) (bool, error)

func (SQLProvider) Config added in v1.5.0

func (SQLProvider) Config(clientID, clientSecret, redirectURL string) *oauth2.Config

func (SQLProvider) CreateBookmarks added in v1.5.0

func (p SQLProvider) CreateBookmarks(ctx context.Context, user string, token *oauth2.Token, branch, text string) error

func (SQLProvider) CreateRepo added in v1.5.0

func (p SQLProvider) CreateRepo(ctx context.Context, user string, token *oauth2.Token, name string) error

func (SQLProvider) CreateUser added in v1.5.0

func (p SQLProvider) CreateUser(ctx context.Context, user, password string) error

func (SQLProvider) CurrentUser added in v1.5.0

func (SQLProvider) CurrentUser(ctx context.Context, token *oauth2.Token) (*User, error)

func (SQLProvider) DefaultServer added in v1.5.0

func (SQLProvider) DefaultServer() string

func (SQLProvider) GetBookmarks added in v1.5.0

func (p SQLProvider) GetBookmarks(ctx context.Context, user, ref string, token *oauth2.Token) (string, string, error)

func (SQLProvider) GetBranches added in v1.5.0

func (p SQLProvider) GetBranches(ctx context.Context, user string, token *oauth2.Token) ([]*Branch, error)

func (SQLProvider) GetCommits added in v1.5.0

func (p SQLProvider) GetCommits(ctx context.Context, user string, token *oauth2.Token, ref string, page, perPage int) ([]*Commit, error)

func (SQLProvider) GetTags added in v1.5.0

func (p SQLProvider) GetTags(ctx context.Context, user string, token *oauth2.Token) ([]*Tag, error)

func (SQLProvider) Name added in v1.5.0

func (SQLProvider) Name() string

func (SQLProvider) RepoExists added in v1.5.0

func (p SQLProvider) RepoExists(ctx context.Context, user string, token *oauth2.Token, name string) (bool, error)

func (SQLProvider) SetPassword added in v1.5.0

func (p SQLProvider) SetPassword(ctx context.Context, user, password string) error

func (SQLProvider) UpdateBookmarks added in v1.5.0

func (p SQLProvider) UpdateBookmarks(ctx context.Context, user string, token *oauth2.Token, sourceRef, branch, text, expectSHA string) error

type SystemError added in v1.5.3

type SystemError struct {
	Msg string // message shown to the user
	Err error  // underlying error
}

SystemError represents a server-side failure that prevents the request from completing. The message is shown on a dedicated error page while the underlying error is logged for debugging.

func (SystemError) Error added in v1.5.3

func (e SystemError) Error() string

func (SystemError) Unwrap added in v1.5.3

func (e SystemError) Unwrap() error

type TabInfo added in v1.3.0

type TabInfo struct {
	Index       int
	Name        string
	IndexName   string
	Href        string
	LastPageSha string
}

TabInfo is used by templates to display tab navigation with indexes.

type Tag added in v1.0.22

type Tag struct {
	Name string
}

func GetTags

func GetTags(ctx context.Context, user string, token *oauth2.Token) ([]*Tag, error)

type User added in v1.0.22

type User struct {
	Login string
}

type UserError added in v1.5.3

type UserError struct {
	Msg string // message shown to the user
	Err error  // underlying error
}

UserError wraps an error message intended for display to the user. It satisfies the error interface so it can be returned like a normal error. UserError describes an error that has a user facing message. The wrapped error can be inspected using errors.As/Is.

func (UserError) Error added in v1.5.3

func (e UserError) Error() string

Error implements the error interface by returning the underlying error message so logs and comparisons use the wrapped error.

func (UserError) Unwrap added in v1.5.3

func (e UserError) Unwrap() error

Unwrap returns the underlying error.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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