helpers

package module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2023 License: MIT Imports: 12 Imported by: 2

README

CircleCI codecov GoDoc Go Report Card

go-helpers

Description

Go helpers is a package for provides the helpers function for simplify some code for my projects.

Requirements

Go programming language

Installation

Run the following command to install the package:

go get github.com/moemoe89/go-helpers
Example

You can find a example for the implementation at example repository.

Documentation

Overview

Package helpers is a Go package for provides the helpers function for simplify some code

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckInTag

func CheckInTag(v interface{}, filterField, tag string) []string

CheckInTag represent the helpers for check attribute inside of struct

func CheckMatchTag

func CheckMatchTag(v interface{}, field, tag string) string

CheckMatchTag represent the helpers for check attribute match of struct

func DoRequest

func DoRequest(opt *HttpOptions, rs interface{}) (int, error)

func HttpMock

func HttpMock(pattern string, statusCode int, response interface{}) *httptest.Server

func OrderByHandler

func OrderByHandler(field, tag string, model interface{}) string

OrderByHandler represent the helpers for handle order by query

func PaginationSetter

func PaginationSetter(perPageString, pageString string) (int, int, int, error)

PaginationSetter represent the helpers for pagination

Types

type HttpOptions

type HttpOptions struct {
	Ctx     context.Context
	Url     string
	TO      *time.Duration
	Headers map[string]string
	Queries map[string]string
	Data    []byte
	Method  string
}

Directories

Path Synopsis
cloudstorage module
diskstorage module
pkg
diskstorage
Package diskstorage is a generated GoMock package.
Package diskstorage is a generated GoMock package.
imagecompressor
Package imagecompressor is a generated GoMock package.
Package imagecompressor is a generated GoMock package.

Jump to

Keyboard shortcuts

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