Documentation
¶
Index ¶
- Constants
- Variables
- func Debug(enable bool)
- type Client
- type CommonPageRequest
- type Option
- type ResponseOne
- type ResponsePage
- type RestClient
- func (rc *RestClient) Auth(token string) *RestClient
- func (rc *RestClient) Form(req map[string]string) (code int, err error)
- func (rc *RestClient) FormUrl(req map[string]string) (code int, err error)
- func (rc *RestClient) Get(query map[string]string) (code int, err error)
- func (rc *RestClient) Header(name, value string) *RestClient
- func (rc *RestClient) Path(name ...string) *RestClient
- func (rc *RestClient) Post(payload any) (code int, err error)
- func (rc *RestClient) ResponseJson(respPtr any) *RestClient
- type Rpc
- type UserRoleRequest
Constants ¶
View Source
const ( CodeNotAllow int = 401 CodeNotFound int = 404 CodeSuccess int = 200 )
View Source
const ( AuthHeader = "Authorization" Realm = "Bearer " )
View Source
const (
ApiUserRole = "/userRole"
)
Variables ¶
View Source
var ( InnerServerErr = errors.New("500") NotFoundErr = errors.New("404") )
View Source
var DebugEnable bool
Functions ¶
Types ¶
type Client ¶
type Client interface { GetUserRoleList(request UserRoleRequest) (resp ResponseOne, err error) //获取单个用户权限列表 GetRoles(request UserRoleRequest) (resp ResponseOne, err error) //获取单个用户权限列表 }
type CommonPageRequest ¶
type ResponseOne ¶
type ResponsePage ¶
type RestClient ¶
type RestClient struct {
// contains filtered or unexported fields
}
func NewRest ¶
func NewRest(host string) *RestClient
func (*RestClient) Auth ¶
func (rc *RestClient) Auth(token string) *RestClient
func (*RestClient) FormUrl ¶
func (rc *RestClient) FormUrl(req map[string]string) (code int, err error)
func (*RestClient) Header ¶
func (rc *RestClient) Header(name, value string) *RestClient
func (*RestClient) Path ¶
func (rc *RestClient) Path(name ...string) *RestClient
func (*RestClient) ResponseJson ¶
func (rc *RestClient) ResponseJson(respPtr any) *RestClient
Click to show internal directories.
Click to hide internal directories.