uri

package
v0.0.0-...-03b241a Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HasScheme

func HasScheme(scheme, rawuri string) bool

HasScheme returns true if the given uri has the given scheme, false otherwise.

Types

type URI

type URI struct {
	*url.URL
	Values url.Values
}

URI implements a parser for a URI format based on the the PKCS #11 URI Scheme defined in https://tools.ietf.org/html/rfc7512

These URIs will be used to define the key names in a KMS.

func New

func New(scheme string, values url.Values) *URI

New creates a new URI from a scheme and key-value pairs.

func NewFile

func NewFile(path string) *URI

NewFile creates an uri for a file.

func Parse

func Parse(rawuri string) (*URI, error)

Parse returns the URI for the given string or an error.

func ParseWithScheme

func ParseWithScheme(scheme, rawuri string) (*URI, error)

ParseWithScheme returns the URI for the given string only if it has the given scheme.

func (*URI) Get

func (u *URI) Get(key string) string

Get returns the first value in the uri with the give n key, it will return empty string if that field is not present.

Jump to

Keyboard shortcuts

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