cloudplatform

package module
v0.0.1-beta3 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

README

cloudplatform

The Cloud Platform Private SDK

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddCtx

func AddCtx(ctx ...*Context)

Types

type Context

type Context struct {
	ID       uint
	BaseUrl  string
	Uid      int
	Username string
	Password string
	// contains filtered or unexported fields
}

func GetCtxByID

func GetCtxByID(id uint) *Context

func GetCtxByUrl

func GetCtxByUrl(baseUrl string) *Context

type Request

type Request interface {
	Url() string
	Method() string
	Header() http.Header
	Values() (values url.Values)
	Form() (form url.Values)
	Body() any
}

type Response

type Response[T any] struct {
	StatusCode int    `json:"-"`
	Error      string `json:"error"`
	Result     T      `json:"-"`
}

func Execute

func Execute[R Request, RR any](ctx *Context, request R) (resp Response[RR], err error)

Execute 接口请求入口

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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