xgo

package module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2022 License: BSD-3-Clause Imports: 0 Imported by: 0

README

xgo build PkgGoDev Go Report Card

Collection of packages to serve as the building blocks for developing Go applications.

Install

$ go get github.com/sudo-suhas/xgo

Usage

Usage for each package is documentated in the respective readme.

Decision Log

The rationale for important design decisions is documented in decision-log.md.

Credits

A lot of the ideas for the errors package are from these articles and talks:

The JSON decoder implementation in the httputil package is based on "How to Parse a JSON Request Body in Go" by Alex Edwards.

The URL builder in the httputil package drew some inspiration from https://github.com/balazsbotond/urlcat.

Documentation

Overview

Package xgo is a collection of packages to serve as the building blocks for developing Go applications.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JSONer

type JSONer interface {
	JSON() interface{}
}

JSONer is implemented by any value that has a JSON method.

type Validator

type Validator interface {
	// Validate validates the given value.
	Validate(interface{}) error
}

Validator is implemented by any value which has a Validate method.

type ValidatorFunc

type ValidatorFunc func(interface{}) error

ValidatorFunc type is an adapter to allow the use of ordinary functions as a Validator. If f is a function with the appropriate signature, ValidatorFunc(f) is an Validator that calls f.

func (ValidatorFunc) Validate

func (f ValidatorFunc) Validate(v interface{}) error

Validate calls f(v).

Directories

Path Synopsis
Package errors is a general purpose error handling package, with few extra bells and whistles for HTTP interop.
Package errors is a general purpose error handling package, with few extra bells and whistles for HTTP interop.
Package httputil provides HTTP utility functions, focused around decoding and responding with JSON.
Package httputil provides HTTP utility functions, focused around decoding and responding with JSON.

Jump to

Keyboard shortcuts

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