GitXplorerGitXplorer
Q

go-encodeUrl

public
3 stars
1 forks
0 issues

Commits

List of commits on branch master.
Unverified
645a9dbeee154c68e218053e604de21f1e3d91d0

Now you can use - to omit a field

committed 8 years ago
Unverified
461582b68ef66ed356c0a427aa54e7b5aa5a4c31

README: Add funtions

committed 8 years ago
Unverified
6600b1046c55c44276478d9f9acf6f835902208e

README: add example

committed 8 years ago
Unverified
4ba7963b02ff2a26b3faa1387c586de7e5b94d0c

Add README.md

committed 8 years ago
Unverified
dabace4dfbedc22aae22784fd431cba3b1e9c023

Add license

QQuentinPerez committed 9 years ago
Unverified
b2b9f4e7b0ac02f7642f8a54f6311401d45aaa2a

Add itoaIfNotNil

committed 9 years ago

README

The README file for this repository.

Overview

A package to encode your structures in URL

Installation

āš ļø Make sure that Go is installed on your computer.

$ go get github.com/QuentinPerez/go-encodeUrl

Now, the package is ready to use.

Examples

import "github.com/QuentinPerez/go-encodeUrl"


type ID struct {
	Name        string `url:"name,ifStringIsNotEmpty"`
    //                        ^^        ^^^
    //              variable name  |  function
	DisplayName string `url:"display-name,ifStringIsNotEmpty"`
}


func main() {
	values, errs := encurl.Translate(&ID{"NotEmpty", ""})
	if errs != nil {
        fmt.Printf("errors %v", errs)
        return
	}
	fmt.Printf("https://example.com/?%v\n", values.Encode()) // https://example.com/?name=NotEmpty
}

Functions

ifStringIsNotEmpty
ifBoolIsFalse
ifBoolIsTrue
itoa
itoaIfNotNil

Development

Feel free to contribute šŸ˜ƒšŸ»

License

MIT