url

package module
v0.0.0-...-593e88d Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2022 License: MIT Imports: 4 Imported by: 0

README

SURL - Serializable URL

SURL extends net/url and provides functions to serialize/deserialize url to/from json and db.

Install

go get github.com/edwardzjl/surl

Usage

import url "github.com/edwardzjl/surl"

License

This project is under MIT License. See the LICENSE file for the full license text.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type URL

type URL struct {
	url.URL
}

extends url.URL to support driver.Scan and driver.Value see https://husobee.github.io/golang/database/2015/06/12/scanner-valuer.html

func Parse

func Parse(rawURL string) (*URL, error)

func (URL) MarshalJSON

func (pu URL) MarshalJSON() ([]byte, error)

func (*URL) Scan

func (mUrl *URL) Scan(value interface{}) error

func (*URL) UnmarshalJSON

func (pu *URL) UnmarshalJSON(data []byte) error

func (URL) Value

func (mUrl URL) Value() (driver.Value, error)

Jump to

Keyboard shortcuts

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