util

package
v0.0.0-...-575d1e0 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StatusAll      = "all"      // 전체
	StatusReady    = "ready"    // 미결제
	StatusPaid     = "paid"     // 결제완료
	StatusCanceled = "canceled" // 결제취소
	StatusFailed   = "failed"   // 결제실패

	SortDESCStarted = "-started" // 결제시작시각(결제창오픈시각) 기준 내림차순(DESC) 정렬
	SortASCStarted  = "started"  // 결제시작시각(결제창오픈시각) 기준 오름차순(ASC) 정렬
	SortDESCPaid    = "-paid"    // 결제완료시각 기준 내림차순(DESC) 정렬
	SortASCPaid     = "paid"     // 결제완료시각 기준 오름차순(ASC) 정렬
	SortDESCUpdated = "-updated" // 최종수정시각(결제건 상태변화마다 수정시각 변경됨) 기준 내림차순(DESC) 정렬
	SortASCUpdated  = "updated"  // 최종수정시각(결제건 상태변화마다 수정시각 변경됨) 기준 오름차순(ASC) 정렬
)
View Source
const (
	CodeOK = 0

	ErrStatusUnauthorized = "iamport: unauthorized"
	ErrStatusNotFound     = "iamport: invalid imp_uid"
	ErrUnknown            = "iamport: unknown error"

	HeaderContentType     = "Content-Type"
	HeaderContentTypeForm = "application/x-www-form-urlencoded"
	HeaderContentTypeJson = "application/json"
	HeaderAuthorization   = "Authorization"

	GET    = "GET"
	POST   = "POST"
	PUT    = "PUT"
	DELETE = "DELETE"
)

Variables

View Source
var Unmarshaler = protojson.UnmarshalOptions{
	DiscardUnknown: true,
}

Functions

func Call

func Call(client *http.Client, token string, url string, method Method) ([]byte, error)

func CallWithForm

func CallWithForm(client *http.Client, token string, url string, method Method, param []byte) ([]byte, error)

func CallWithJson

func CallWithJson(client *http.Client, token string, url string, method Method, param []byte) ([]byte, error)

func GetJoinString

func GetJoinString(values ...string) string

func GetQueryPrefix

func GetQueryPrefix(isFirst *bool) string

func GetRandomString

func GetRandomString(length int) string

func ValidateSortParameter

func ValidateSortParameter(src string) bool

func ValidateStatusParameter

func ValidateStatusParameter(src string) bool

Types

type Method

type Method string

type Status

type Status string

Status 결제 상태

Jump to

Keyboard shortcuts

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