Help us shape the future of Go! Take the 2026 Go Developer Survey

homelinks

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package homelinks stores shared and personal dashboard shortcuts in app state.

Index

Constants

View Source
const MaxLinks = 32

Variables

View Source
var (
	ErrInvalid  = errors.New("invalid homepage links")
	ErrConflict = errors.New("homepage links changed in another session")
)

Functions

func PersonalKey

func PersonalKey(ownerID int64) string

func Save

func Save(ctx context.Context, ownerID int64, revision string, links []Link) error

Save rejects stale editors instead of silently overwriting their changes.

Types

type Link struct {
	Title string `json:"title"`
	URL   string `json:"url"`
}

func Validate

func Validate(links []Link) ([]Link, error)

type State

type State struct {
	Links []Link `json:"links"`
	// contains filtered or unexported fields
}

func Load

func Load(ctx context.Context, ownerID int64) (*State, error)

func (*State) Name

func (s *State) Name() string

Name keeps personal records isolated without changing storage paths or schema.

func (*State) Revision

func (s *State) Revision() string

Jump to

Keyboard shortcuts

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