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 ¶
- Variables
- func CacheExpires(r *http.Response) time.Time
- func GetUx(c Context) string
- func InjectUx(req *http.Request, subject string)
- type APIClient
- type APIKey
- type APIResponse
- type AllOfinlineResponse2001Data
- type AllOfinlineResponse200Data
- type BasicAuth
- type BindBodyConfig
- type BindBodyToken
- type BindBodyUser
- type BindBodyUserPatch
- type BindBodyUserProfile
- type BindQueryUser
- type ConfigsApiService
- func (a *ConfigsApiService) ConfigsKeyDelete(ctx context.Context, key string) (HttputilJsonResponse, *http.Response, error)
- func (a *ConfigsApiService) ConfigsKeyGet(ctx context.Context, key string) (HttputilJsonResponse, *http.Response, error)
- func (a *ConfigsApiService) ConfigsKeyPut(ctx context.Context, body interface{}, key string) (HttputilJsonResponse, *http.Response, error)
- type Configuration
- type Context
- type GenericSwaggerError
- type GinH
- type HttputilJsonResponse
- type InlineResponse200
- type InlineResponse2001
- type InlineResponse2002
- type InlineResponse2003
- type ModelUser
- type ModelUserFormats
- type ModelUserProfile
- type TokensApiService
- type UsersApiService
- func (a *UsersApiService) UserGet(ctx context.Context, username string) (InlineResponse200, *http.Response, error)
- func (a *UsersApiService) UserProfilePut(ctx context.Context, body BindBodyUserProfile) (HttputilJsonResponse, *http.Response, error)
- func (a *UsersApiService) UsersEmailPatch(ctx context.Context, body BindBodyUserPatch, email string) (HttputilJsonResponse, *http.Response, error)
- func (a *UsersApiService) UsersGet(ctx context.Context, localVarOptionals *UsersApiUsersGetOpts) (InlineResponse2001, *http.Response, error)
- func (a *UsersApiService) UsersPost(ctx context.Context, body BindBodyUser) (InlineResponse2002, *http.Response, error)
- func (a *UsersApiService) UsersUsernameGet(ctx context.Context, username string) (InlineResponse2003, *http.Response, error)
- type UsersApiUsersGetOpts
Constants ¶
This section is empty.
Variables ¶
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 ¶
CacheExpires helper function to determine remaining time before repeating a request.
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 ¶
Change base path to allow switching to mocks
type APIKey ¶
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 BindBodyToken ¶
type BindBodyUser ¶
type BindBodyUserPatch ¶
type BindBodyUserProfile ¶
type BindQueryUser ¶
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 ¶
func (a *ConfigsApiService) ConfigsKeyGet(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) 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 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 HttputilJsonResponse ¶
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 ¶
func (a *TokensApiService) TokensDelete(ctx context.Context) (HttputilJsonResponse, *http.Response, error)
TokensApiService 退出登录 用户状态登出
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return HttputilJsonResponse
func (*TokensApiService) TokensPost ¶
func (a *TokensApiService) TokensPost(ctx context.Context, body BindBodyToken) (HttputilJsonResponse, *http.Response, error)
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 ¶
func (a *UsersApiService) UserProfilePut(ctx context.Context, body BindBodyUserProfile) (HttputilJsonResponse, *http.Response, error)
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 ¶
func (a *UsersApiService) UsersEmailPatch(ctx context.Context, body BindBodyUserPatch, email string) (HttputilJsonResponse, *http.Response, error)
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 ¶
func (a *UsersApiService) UsersPost(ctx context.Context, body BindBodyUser) (InlineResponse2002, *http.Response, error)
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
Source Files
¶
- api_configs.go
- api_tokens.go
- api_users.go
- client.go
- configuration.go
- header.go
- model_all_ofinline_response_200_1_data.go
- model_all_ofinline_response_200_data.go
- model_bind_body_config.go
- model_bind_body_token.go
- model_bind_body_user.go
- model_bind_body_user_patch.go
- model_bind_body_user_profile.go
- model_bind_query_user.go
- model_gin_h.go
- model_httputil_json_response.go
- model_inline_response_200.go
- model_inline_response_200_1.go
- model_inline_response_200_2.go
- model_inline_response_200_3.go
- model_model_user.go
- model_model_user_formats.go
- model_model_user_profile.go
- response.go