http

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2022 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FaaSInfraSuccessCodeSuccess     = "0"
	FaaSInfraFailCodeInternalError  = "k_ec_000001"
	FaaSInfraFailCodeTokenExpire    = "k_ident_013000"
	FaaSInfraFailCodeIllegalToken   = "k_ident_013001"
	FaaSInfraFailCodeMissingToken   = "k_fs_ec_100001"
	FaaSInfraFailCodeRateLimitError = "k_fs_ec_000004"
)
View Source
const (
	PathFaaSInfraPathMongodb = "/resource/v3/namespaces/:namespace/db"
	PathFaaSInfraPathRedis   = "/resource/v2/namespaces/:namespace/cache"
	FaaSInfraPathFile        = "/resource/v2/namespaces/:namespace/file"
)

Variables

This section is empty.

Functions

func BatchCreate

func BatchCreate(ctx context.Context, param interface{}) ([]primitive.ObjectID, error)

func Count

func Count(ctx context.Context, param interface{}) (int64, error)

func Create

func Create(ctx context.Context, param interface{}) (*structs.RecordOnlyId, error)

func Delete

func Delete(ctx context.Context, param interface{}) error

func Distinct

func Distinct(ctx context.Context, param interface{}, results interface{}) error

func DoRequestFile

func DoRequestFile(ctx context.Context, contentType string, body *bytes.Buffer) ([]byte, error)

func DoRequestRedis

func DoRequestRedis(ctx context.Context, param interface{}) ([]byte, map[string]interface{}, error)

func Find

func Find(ctx context.Context, param, results interface{}) error

func FindOne

func FindOne(ctx context.Context, param, result interface{}) error

func GetCommonHttpClient

func GetCommonHttpClient() *http.Client

func GetFaaSInfraPathFile

func GetFaaSInfraPathFile() string

func GetFaaSInfraPathMongodb

func GetFaaSInfraPathMongodb() string

func GetFaaSInfraPathRedis

func GetFaaSInfraPathRedis() string

func HasError

func HasError(errCode string) bool

func IsSysError

func IsSysError(errCode string) bool

func Update

func Update(ctx context.Context, param interface{}) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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