client

package
v0.0.0-...-db25b86 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2021 License: Apache-2.0 Imports: 21 Imported by: 0

README

Go API client for client

This is a moreu server.

Overview

This API client was generated by the swagger-codegen project. By using the swagger-spec from a remote server, you can easily generate an API client.

  • API version: 1.0.0
  • Package version: 1.0.0
  • Build package: io.swagger.codegen.v3.generators.go.GoClientCodegen For more information, please visit https://saltbo.cn

Installation

Put the package under your project folder and add the following in import:

import "./client"

Documentation for API Endpoints

All URIs are relative to /api/moreu

Class Method HTTP request Description
ConfigsApi ConfigsKeyDelete Delete /configs/{key} 删除配置项
ConfigsApi ConfigsKeyGet Get /configs/{key} 获取配置项
ConfigsApi ConfigsKeyPut Put /configs/{key} 修改配置项
TokensApi TokensDelete Delete /tokens 退出登录
TokensApi TokensPost Post /tokens 登录/密码重置
UsersApi UserGet Get /user 当前登录用户信息
UsersApi UserProfilePut Put /user/profile 修改个人信息
UsersApi UsersEmailPatch Patch /users/{email} 更新一项用户信息
UsersApi UsersGet Get /users 用户列表
UsersApi UsersPost Post /users 用户注册
UsersApi UsersUsernameGet Get /users/{username} 用户查询

Documentation For Models

Documentation For Authorization

Endpoints do not require authorization.

Author

saltbo@foxmail.com

Documentation

Overview

* Moreu API * * This is a moreu server. * * API version: 1.0.0 * Contact: saltbo@foxmail.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Moreu API * * This is a moreu server. * * API version: 1.0.0 * Contact: saltbo@foxmail.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Moreu API * * This is a moreu server. * * API version: 1.0.0 * Contact: saltbo@foxmail.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Moreu API * * This is a moreu server. * * API version: 1.0.0 * Contact: saltbo@foxmail.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Moreu API * * This is a moreu server. * * API version: 1.0.0 * Contact: saltbo@foxmail.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Moreu API * * This is a moreu server. * * API version: 1.0.0 * Contact: saltbo@foxmail.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Moreu API * * This is a moreu server. * * API version: 1.0.0 * Contact: saltbo@foxmail.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Moreu API * * This is a moreu server. * * API version: 1.0 * Contact: saltbo@foxmail.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Moreu API * * This is a moreu server. * * API version: 1.0.0 * Contact: saltbo@foxmail.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Moreu API * * This is a moreu server. * * API version: 1.0.0 * Contact: saltbo@foxmail.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Moreu API * * This is a moreu server. * * API version: 1.0.0 * Contact: saltbo@foxmail.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Moreu API * * This is a moreu server. * * API version: 1.0.0 * Contact: saltbo@foxmail.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Moreu API * * This is a moreu server. * * API version: 1.0.0 * Contact: saltbo@foxmail.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Moreu API * * This is a moreu server. * * API version: 1.0.0 * Contact: saltbo@foxmail.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Moreu API * * This is a moreu server. * * API version: 1.0.0 * Contact: saltbo@foxmail.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Moreu API * * This is a moreu server. * * API version: 1.0.0 * Contact: saltbo@foxmail.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Moreu API * * This is a moreu server. * * API version: 1.0.0 * Contact: saltbo@foxmail.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Moreu API * * This is a moreu server. * * API version: 1.0.0 * Contact: saltbo@foxmail.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Moreu API * * This is a moreu server. * * API version: 1.0.0 * Contact: saltbo@foxmail.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Moreu API * * This is a moreu server. * * API version: 1.0.0 * Contact: saltbo@foxmail.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Moreu API * * This is a moreu server. * * API version: 1.0.0 * Contact: saltbo@foxmail.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Moreu API * * This is a moreu server. * * API version: 1.0.0 * Contact: saltbo@foxmail.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Moreu API * * This is a moreu server. * * API version: 1.0.0 * Contact: saltbo@foxmail.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

Index

Constants

This section is empty.

Variables

View Source
var (
	// ContextOAuth2 takes a oauth2.TokenSource as authentication for the request.
	ContextOAuth2 = contextKey("token")

	// ContextBasicAuth takes BasicAuth as authentication for the request.
	ContextBasicAuth = contextKey("basic")

	// ContextAccessToken takes a string oauth2 access token as authentication for the request.
	ContextAccessToken = contextKey("accesstoken")

	// ContextAPIKey takes an APIKey as authentication for the request
	ContextAPIKey = contextKey("apikey")
)

Functions

func CacheExpires

func CacheExpires(r *http.Response) time.Time

CacheExpires helper function to determine remaining time before repeating a request.

func GetUx

func GetUx(c Context) string

func InjectUx

func InjectUx(req *http.Request, subject string)

Types

type APIClient

type APIClient struct {
	ConfigsApi *ConfigsApiService

	TokensApi *TokensApiService

	UsersApi *UsersApiService
	// contains filtered or unexported fields
}

APIClient manages communication with the Moreu API API v1.0.0 In most cases there should be only one, shared, APIClient.

func NewAPIClient

func NewAPIClient(cfg *Configuration) *APIClient

NewAPIClient creates a new API client. Requires a userAgent string describing your application. optionally a custom http.Client to allow for advanced features such as caching.

func (*APIClient) ChangeBasePath

func (c *APIClient) ChangeBasePath(path string)

Change base path to allow switching to mocks

type APIKey

type APIKey struct {
	Key    string
	Prefix string
}

APIKey provides API key based authentication to a request passed via context using ContextAPIKey

type APIResponse

type APIResponse struct {
	*http.Response `json:"-"`
	Message        string `json:"message,omitempty"`
	// Operation is the name of the swagger operation.
	Operation string `json:"operation,omitempty"`
	// RequestURL is the request URL. This value is always available, even if the
	// embedded *http.Response is nil.
	RequestURL string `json:"url,omitempty"`
	// Method is the HTTP method used for the request.  This value is always
	// available, even if the embedded *http.Response is nil.
	Method string `json:"method,omitempty"`
	// Payload holds the contents of the response body (which may be nil or empty).
	// This is provided here as the raw response.Body() reader will have already
	// been drained.
	Payload []byte `json:"-"`
}

func NewAPIResponse

func NewAPIResponse(r *http.Response) *APIResponse

func NewAPIResponseWithError

func NewAPIResponseWithError(errorMessage string) *APIResponse

type AllOfinlineResponse2001Data

type AllOfinlineResponse2001Data struct {
	List  []ModelUserFormats `json:"list,omitempty"`
	Total int32              `json:"total,omitempty"`
}

type AllOfinlineResponse200Data

type AllOfinlineResponse200Data struct {
	Profile *ModelUserProfile `json:"profile,omitempty"`
	User    *ModelUser        `json:"user,omitempty"`
}

type BasicAuth

type BasicAuth struct {
	UserName string `json:"userName,omitempty"`
	Password string `json:"password,omitempty"`
}

BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth

type BindBodyConfig

type BindBodyConfig struct {
	Key   string `json:"key,omitempty"`
	Value string `json:"value,omitempty"`
}

type BindBodyToken

type BindBodyToken struct {
	Captcha  string `json:"captcha,omitempty"`
	Email    string `json:"email"`
	Password string `json:"password"`
}

type BindBodyUser

type BindBodyUser struct {
	Email    string `json:"email"`
	Password string `json:"password"`
	Ticket   string `json:"ticket,omitempty"`
}

type BindBodyUserPatch

type BindBodyUserPatch struct {
	Activated bool   `json:"activated,omitempty"`
	Password  string `json:"password,omitempty"`
	Token     string `json:"token"`
}

type BindBodyUserProfile

type BindBodyUserProfile struct {
	Avatar   string `json:"avatar,omitempty"`
	Bio      string `json:"bio,omitempty"`
	Company  string `json:"company,omitempty"`
	Location string `json:"location,omitempty"`
	Nickname string `json:"nickname,omitempty"`
	Url      string `json:"url,omitempty"`
}

type BindQueryUser

type BindQueryUser struct {
	Email  string `json:"email,omitempty"`
	Limit  int32  `json:"limit,omitempty"`
	Offset int32  `json:"offset,omitempty"`
}

type ConfigsApiService

type ConfigsApiService service

func (*ConfigsApiService) ConfigsKeyDelete

func (a *ConfigsApiService) ConfigsKeyDelete(ctx context.Context, key string) (HttputilJsonResponse, *http.Response, error)

ConfigsApiService 删除配置项 根据键名删除配置项

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param key 键名

@return HttputilJsonResponse

func (*ConfigsApiService) ConfigsKeyGet

ConfigsApiService 获取配置项 根据键名获取配置项

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param key 键名

@return HttputilJsonResponse

func (*ConfigsApiService) ConfigsKeyPut

func (a *ConfigsApiService) ConfigsKeyPut(ctx context.Context, body interface{}, key string) (HttputilJsonResponse, *http.Response, error)

ConfigsApiService 修改配置项 根据键名修改配置项

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param body 参数
  • @param key 键名

@return HttputilJsonResponse

type Configuration

type Configuration struct {
	BasePath      string            `json:"basePath,omitempty"`
	Host          string            `json:"host,omitempty"`
	Scheme        string            `json:"scheme,omitempty"`
	DefaultHeader map[string]string `json:"defaultHeader,omitempty"`
	UserAgent     string            `json:"userAgent,omitempty"`
	HTTPClient    *http.Client
}

func NewConfiguration

func NewConfiguration() *Configuration

func (*Configuration) AddDefaultHeader

func (c *Configuration) AddDefaultHeader(key string, value string)

type Context

type Context interface {
	GetHeader(key string) string
}

type GenericSwaggerError

type GenericSwaggerError struct {
	// contains filtered or unexported fields
}

GenericSwaggerError Provides access to the body, error and model on returned errors.

func (GenericSwaggerError) Body

func (e GenericSwaggerError) Body() []byte

Body returns the raw bytes of the response

func (GenericSwaggerError) Error

func (e GenericSwaggerError) Error() string

Error returns non-empty string if there was an error.

func (GenericSwaggerError) Model

func (e GenericSwaggerError) Model() interface{}

Model returns the unpacked model of the error

type GinH

type GinH struct {
}

type HttputilJsonResponse

type HttputilJsonResponse struct {
	Code int32        `json:"code,omitempty"`
	Data *interface{} `json:"data,omitempty"`
	Msg  string       `json:"msg,omitempty"`
}

type InlineResponse200

type InlineResponse200 struct {
	Data                 *AllOfinlineResponse200Data `json:"data,omitempty"`
	HttputilJSONResponse *HttputilJsonResponse       `json:"httputil.JSONResponse,omitempty"`
}

type InlineResponse2001

type InlineResponse2001 struct {
	Data                 *AllOfinlineResponse2001Data `json:"data,omitempty"`
	HttputilJSONResponse *HttputilJsonResponse        `json:"httputil.JSONResponse,omitempty"`
}

type InlineResponse2002

type InlineResponse2002 struct {
	Data                 *ModelUser            `json:"data,omitempty"`
	HttputilJSONResponse *HttputilJsonResponse `json:"httputil.JSONResponse,omitempty"`
}

type InlineResponse2003

type InlineResponse2003 struct {
	Data                 *ModelUserProfile     `json:"data,omitempty"`
	HttputilJSONResponse *HttputilJsonResponse `json:"httputil.JSONResponse,omitempty"`
}

type ModelUser

type ModelUser struct {
	Created  string `json:"created,omitempty"`
	Email    string `json:"email,omitempty"`
	Id       int32  `json:"id,omitempty"`
	Role     string `json:"role,omitempty"`
	Status   string `json:"status,omitempty"`
	Ticket   string `json:"ticket,omitempty"`
	Updated  string `json:"updated,omitempty"`
	Username string `json:"username,omitempty"`
	// Global unique user ID
	Ux string `json:"ux,omitempty"`
}

type ModelUserFormats

type ModelUserFormats struct {
	Avatar   string `json:"avatar,omitempty"`
	Bio      string `json:"bio,omitempty"`
	Company  string `json:"company,omitempty"`
	Created  string `json:"created,omitempty"`
	Email    string `json:"email,omitempty"`
	Id       int32  `json:"id,omitempty"`
	Location string `json:"location,omitempty"`
	Nickname string `json:"nickname,omitempty"`
	Role     string `json:"role,omitempty"`
	Status   string `json:"status,omitempty"`
	Updated  string `json:"updated,omitempty"`
	Url      string `json:"url,omitempty"`
	Username string `json:"username,omitempty"`
	Ux       string `json:"ux,omitempty"`
}

type ModelUserProfile

type ModelUserProfile struct {
	Avatar   string `json:"avatar,omitempty"`
	Bio      string `json:"bio,omitempty"`
	Company  string `json:"company,omitempty"`
	Created  string `json:"created,omitempty"`
	Id       int32  `json:"id,omitempty"`
	Location string `json:"location,omitempty"`
	Nickname string `json:"nickname,omitempty"`
	Updated  string `json:"updated,omitempty"`
	Url      string `json:"url,omitempty"`
	Ux       string `json:"ux,omitempty"`
}

type TokensApiService

type TokensApiService service

func (*TokensApiService) TokensDelete

TokensApiService 退出登录 用户状态登出

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().

@return HttputilJsonResponse

func (*TokensApiService) TokensPost

TokensApiService 登录/密码重置 用于账户登录和申请密码重置

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param body 参数

@return HttputilJsonResponse

type UsersApiService

type UsersApiService service

func (*UsersApiService) UserGet

func (a *UsersApiService) UserGet(ctx context.Context, username string) (InlineResponse200, *http.Response, error)

UsersApiService 当前登录用户信息 获取已登录用户的详细信息

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param username 用户名

@return InlineResponse200

func (*UsersApiService) UserProfilePut

UsersApiService 修改个人信息 更新用户的个人信息

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param body 参数

@return HttputilJsonResponse

func (*UsersApiService) UsersEmailPatch

UsersApiService 更新一项用户信息 用于账户激活和密码重置

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param body 参数
  • @param email 邮箱

@return HttputilJsonResponse

func (*UsersApiService) UsersGet

func (a *UsersApiService) UsersGet(ctx context.Context, localVarOptionals *UsersApiUsersGetOpts) (InlineResponse2001, *http.Response, error)

func (*UsersApiService) UsersPost

UsersApiService 用户注册 注册一个用户

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param body 参数

@return InlineResponse2002

func (*UsersApiService) UsersUsernameGet

func (a *UsersApiService) UsersUsernameGet(ctx context.Context, username string) (InlineResponse2003, *http.Response, error)

UsersApiService 用户查询 获取一个用户的公开信息

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param username 用户名

@return InlineResponse2003

type UsersApiUsersGetOpts

type UsersApiUsersGetOpts struct {
	Email  optional.String
	Limit  optional.Int32
	Offset optional.Int32
}

Jump to

Keyboard shortcuts

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