util

package
v3.4.1-alpha.0 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApiPost

func ApiPost(ctx context.Context, api string, req, resp any) (err error)

func Batch

func Batch[T any, V any](fn func(T) V, ts []T) []V

func CallApi

func CallApi[T any](ctx context.Context, api string, req any) (*T, error)

func GetPageAll

func GetPageAll[A interface {
	GetPagination() *sdkws.RequestPagination
}, B, C any](ctx context.Context, api string, req A, fn func(resp *B) []C) ([]C, error)

func NoticeChange

func NoticeChange[T any](fn func(data string)) func(ctx context.Context, state int, value T) error

Types

type ApiResponse

type ApiResponse struct {
	ErrCode int             `json:"errCode"`
	ErrMsg  string          `json:"errMsg"`
	ErrDlt  string          `json:"errDlt"`
	Data    json.RawMessage `json:"data"`
}

Jump to

Keyboard shortcuts

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