uri

package
v0.1.19 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2023 License: BSD-3-Clause Imports: 3 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Resource

type Resource func() URIs

Resource is a source of URIs

type Resources

type Resources []Resource

Resources is a list of resources

func (*Resources) Add

func (rs *Resources) Add(r Resource) *Resources

Add adds the given resource

func (*Resources) Generate

func (rs *Resources) Generate() URIs

type URI

type URI struct {

	// brief label
	Label string

	// URL path
	URL string

	// icon
	Icon icons.Icon

	// extra information, e.g. detailed description, type, arguments, etc;
	Desc string

	// lang specific or other, e.g. class or type
	Extra map[string]string

	// Function to call for this item, if not nil
	Func func()
}

URI uniform resource identifier for general app resources.

func (URI) HasScheme

func (ur URI) HasScheme(scheme string) bool

func (*URI) SetURL

func (ur *URI) SetURL(scheme, host, path string)

func (URI) String

func (ur URI) String() string

type URIs

type URIs []URI

URIs is a collection of URI

func (URIs) Filter

func (ur URIs) Filter(str string) URIs

todo: needs a lot smarter filtering

Jump to

Keyboard shortcuts

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