Documentation ¶
Index ¶
- func RegisterAppService(e *echo.Echo, srv AppService)
- func RegisterAppServiceWithPrefix(e *echo.Echo, srv AppService, prefix string)
- type AppService
- type AuthError
- type BindError
- type CommonError
- type Empty
- type Env
- type EnvListRequest
- type EnvListResponse
- type Error
- type ErrorCode
- type FieldError
- type GenericError
- type KVHistoryItem
- type KVHistoryRequest
- type KVHistoryResponse
- type Key
- type KeyListRequest
- type KeyListResponse
- type KeyValue
- type KeyValueListRequest
- type KeyValueListResponse
- type KeyValueRequest
- type KeyValueResponse
- type Product
- type ProductListRequest
- type ProductListResponse
- type RegisterServiceRequest
- type RegisterServiceResponse
- type SearchKeyValueListRequest
- type Service
- type ServiceListRequest
- type ServiceListResponse
- type ServiceSearchRequest
- type Tag
- type TagListRequest
- type TagListResponse
- type UpdateServiceRequest
- type UpdateServiceResponse
- type UploadProtoFileRequest
- type UploadProtoFileResponse
- type ValidateError
- type ValidateErrorType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterAppService ¶
func RegisterAppService(e *echo.Echo, srv AppService)
RegisterAppService is used to bind routers
func RegisterAppServiceWithPrefix ¶
func RegisterAppServiceWithPrefix(e *echo.Echo, srv AppService, prefix string)
RegisterAppServiceWithPrefix is used to bind routers with custom prefix
Types ¶
type AppService ¶
type AppService interface { AppServiceAuth(c echo.Context) (err error) GetEnv(c echo.Context, req *EnvListRequest) (resp *EnvListResponse, bizError *Error, err error) RegisterService(c echo.Context, req *RegisterServiceRequest) (resp *RegisterServiceResponse, bizError *Error, err error) UpdateService(c echo.Context, req *UpdateServiceRequest) (resp *UpdateServiceResponse, bizError *Error, err error) UploadProtoFile(c echo.Context, req *UploadProtoFileRequest) (resp *UploadProtoFileResponse, bizError *Error, err error) GetTags(c echo.Context, req *TagListRequest) (resp *TagListResponse, bizError *Error, err error) GetProducts(c echo.Context, req *ProductListRequest) (resp *ProductListResponse, bizError *Error, err error) GetServices(c echo.Context, req *ServiceListRequest) (resp *ServiceListResponse, bizError *Error, err error) SearchServices(c echo.Context, req *ServiceSearchRequest) (resp *ServiceListResponse, bizError *Error, err error) GetKeyList(c echo.Context, req *KeyListRequest) (resp *KeyListResponse, bizError *Error, err error) GetKeyValueList(c echo.Context, req *KeyValueListRequest) (resp *KeyValueListResponse, bizError *Error, err error) SearchKeyValueList(c echo.Context, req *SearchKeyValueListRequest) (resp *KeyValueListResponse, bizError *Error, err error) UpdateKeyValue(c echo.Context, req *KeyValueRequest) (resp *KeyValueResponse, bizError *Error, err error) FetchKeyHistory(c echo.Context, req *KVHistoryRequest) (resp *KVHistoryResponse, bizError *Error, err error) }
AppService is the interface contains all the controllers
type AuthError ¶
type AuthError struct {
Message string `json:"message"`
}
AuthError
func (*AuthError) GetMessage ¶
type BindError ¶
type BindError struct {
Message string `json:"message"`
}
BindError
func (*BindError) GetMessage ¶
type CommonError ¶
type CommonError struct { GenericError *GenericError `json:"genericError"` AuthError *AuthError `json:"authError"` ValidateError *ValidateError `json:"validateError"` BindError *BindError `json:"bindError"` }
CommonError
func (*CommonError) Error ¶
func (r *CommonError) Error() string
func (*CommonError) GetAuthError ¶
func (r *CommonError) GetAuthError() *AuthError
func (*CommonError) GetBindError ¶
func (r *CommonError) GetBindError() *BindError
func (*CommonError) GetGenericError ¶
func (r *CommonError) GetGenericError() *GenericError
func (*CommonError) GetValidateError ¶
func (r *CommonError) GetValidateError() *ValidateError
type EnvListResponse ¶
type EnvListResponse struct {
Envs []*Env `json:"envs"`
}
EnvListResponse
func (*EnvListResponse) GetEnvs ¶
func (r *EnvListResponse) GetEnvs() []*Env
type ErrorCode ¶
type ErrorCode int
func (ErrorCode) IsDatabaseError ¶
func (ErrorCode) IsDefaultError ¶
func (ErrorCode) IsEtcdError ¶
func (ErrorCode) IsGeneralError ¶
func (ErrorCode) IsSystemError ¶
type FieldError ¶
type FieldError struct { FieldName string `json:"fieldName"` ErrorType ValidateErrorType `json:"errorType"` }
FieldError
func (*FieldError) GetErrorType ¶
func (r *FieldError) GetErrorType() ValidateErrorType
func (*FieldError) GetFieldName ¶
func (r *FieldError) GetFieldName() string
type GenericError ¶
type GenericError struct {
Message string `json:"message"`
}
GenericError
func (*GenericError) GetMessage ¶
func (r *GenericError) GetMessage() string
type KVHistoryItem ¶
type KVHistoryItem struct { Updated_value string `json:"updated_value"` Updated_date string `json:"updated_date"` Updated_by string `json:"updated_by"` Revision int64 `json:"revision"` }
KVHistoryItem
func (*KVHistoryItem) GetRevision ¶
func (r *KVHistoryItem) GetRevision() int64
func (*KVHistoryItem) GetUpdated_by ¶
func (r *KVHistoryItem) GetUpdated_by() string
func (*KVHistoryItem) GetUpdated_date ¶
func (r *KVHistoryItem) GetUpdated_date() string
func (*KVHistoryItem) GetUpdated_value ¶
func (r *KVHistoryItem) GetUpdated_value() string
type KVHistoryRequest ¶
KVHistoryRequest
func (*KVHistoryRequest) GetKey_id ¶
func (r *KVHistoryRequest) GetKey_id() int
func (*KVHistoryRequest) GetService_id ¶
func (r *KVHistoryRequest) GetService_id() int
type KVHistoryResponse ¶
type KVHistoryResponse struct {
KVhistorys []*KVHistoryItem `json:"KVhistorys"`
}
KVHistoryResponse
func (*KVHistoryResponse) GetKVhistorys ¶
func (r *KVHistoryResponse) GetKVhistorys() []*KVHistoryItem
type Key ¶
type Key struct { Key_id int `json:"key_id"` Key string `json:"key"` DataType string `json:"dataType"` DefaultValue string `json:"defaultValue"` IsWatched bool `json:"isWatched"` }
Key
func (*Key) GetDataType ¶
func (*Key) GetDefaultValue ¶
func (*Key) GetIsWatched ¶
type KeyListRequest ¶
KeyListRequest
func (*KeyListRequest) GetEnv_id ¶
func (r *KeyListRequest) GetEnv_id() int
func (*KeyListRequest) GetService_id ¶
func (r *KeyListRequest) GetService_id() int
type KeyListResponse ¶
type KeyListResponse struct {
Keys []*Key `json:"keys"`
}
KeyListResponse
func (*KeyListResponse) GetKeys ¶
func (r *KeyListResponse) GetKeys() []*Key
type KeyValue ¶
type KeyValue struct { Key_id int `json:"key_id"` Key string `json:"key"` DataType string `json:"dataType"` DefaultValue string `json:"defaultValue"` IsWatched bool `json:"isWatched"` Value string `json:"value"` }
KeyValue
func (*KeyValue) GetDataType ¶
func (*KeyValue) GetDefaultValue ¶
func (*KeyValue) GetIsWatched ¶
type KeyValueListRequest ¶
KeyValueListRequest
func (*KeyValueListRequest) GetKeys ¶
func (r *KeyValueListRequest) GetKeys() []*Key
func (*KeyValueListRequest) GetService_id ¶
func (r *KeyValueListRequest) GetService_id() int
type KeyValueListResponse ¶
type KeyValueListResponse struct {
Key_values []*KeyValue `json:"key_values"`
}
KeyValueListResponse
func (*KeyValueListResponse) GetKey_values ¶
func (r *KeyValueListResponse) GetKey_values() []*KeyValue
type KeyValueRequest ¶
type KeyValueRequest struct { Service_id int `json:"service_id"` Key_values []*KeyValue `json:"key_values"` }
KeyValueRequest
func (*KeyValueRequest) GetKey_values ¶
func (r *KeyValueRequest) GetKey_values() []*KeyValue
func (*KeyValueRequest) GetService_id ¶
func (r *KeyValueRequest) GetService_id() int
type KeyValueResponse ¶
type KeyValueResponse struct {
Key_values []*KeyValue `json:"key_values"`
}
KeyValueResponse
func (*KeyValueResponse) GetKey_values ¶
func (r *KeyValueResponse) GetKey_values() []*KeyValue
type Product ¶
type Product struct { Product_id string `json:"product_id"` Product_name string `json:"product_name"` }
Product
func (*Product) GetProduct_id ¶
func (*Product) GetProduct_name ¶
type ProductListRequest ¶
type ProductListRequest struct {
Env_id int `json:"env_id"`
}
ProductListRequest
func (*ProductListRequest) GetEnv_id ¶
func (r *ProductListRequest) GetEnv_id() int
type ProductListResponse ¶
type ProductListResponse struct {
Products []*Product `json:"products"`
}
ProductListResponse
func (*ProductListResponse) GetProducts ¶
func (r *ProductListResponse) GetProducts() []*Product
type RegisterServiceRequest ¶
type RegisterServiceRequest struct { Env_id int `json:"env_id"` Product_id string `json:"product_id"` Service_name string `json:"service_name"` Tags []*Tag `json:"tags"` Desc string `json:"desc"` }
RegisterServiceRequest
func (*RegisterServiceRequest) GetDesc ¶
func (r *RegisterServiceRequest) GetDesc() string
func (*RegisterServiceRequest) GetEnv_id ¶
func (r *RegisterServiceRequest) GetEnv_id() int
func (*RegisterServiceRequest) GetProduct_id ¶
func (r *RegisterServiceRequest) GetProduct_id() string
func (*RegisterServiceRequest) GetService_name ¶
func (r *RegisterServiceRequest) GetService_name() string
func (*RegisterServiceRequest) GetTags ¶
func (r *RegisterServiceRequest) GetTags() []*Tag
type RegisterServiceResponse ¶
type RegisterServiceResponse struct { Env_id int `json:"env_id"` Product_id string `json:"product_id"` Service_id int `json:"service_id"` Service_name string `json:"service_name"` }
RegisterServiceResponse
func (*RegisterServiceResponse) GetEnv_id ¶
func (r *RegisterServiceResponse) GetEnv_id() int
func (*RegisterServiceResponse) GetProduct_id ¶
func (r *RegisterServiceResponse) GetProduct_id() string
func (*RegisterServiceResponse) GetService_id ¶
func (r *RegisterServiceResponse) GetService_id() int
func (*RegisterServiceResponse) GetService_name ¶
func (r *RegisterServiceResponse) GetService_name() string
type SearchKeyValueListRequest ¶
type SearchKeyValueListRequest struct { Key string `json:"key"` Service_id int `json:"service_id"` Env_id int `json:"env_id"` }
SearchKeyValueListRequest
func (*SearchKeyValueListRequest) GetEnv_id ¶
func (r *SearchKeyValueListRequest) GetEnv_id() int
func (*SearchKeyValueListRequest) GetKey ¶
func (r *SearchKeyValueListRequest) GetKey() string
func (*SearchKeyValueListRequest) GetService_id ¶
func (r *SearchKeyValueListRequest) GetService_id() int
type Service ¶
type Service struct { Service_id int `json:"service_id"` Service_name string `json:"service_name"` Product_id string `json:"product_id"` Product_name string `json:"product_name"` Desc string `json:"desc"` Tags []*Tag `json:"tags"` }
Service
func (*Service) GetProduct_id ¶
func (*Service) GetProduct_name ¶
func (*Service) GetService_id ¶
func (*Service) GetService_name ¶
type ServiceListRequest ¶
type ServiceListRequest struct { Tag_ids []int `json:"tag_ids"` Env_id int `json:"env_id"` Offset int `json:"offset"` Limit int `json:"limit"` }
ServiceListRequest
func (*ServiceListRequest) GetEnv_id ¶
func (r *ServiceListRequest) GetEnv_id() int
func (*ServiceListRequest) GetLimit ¶
func (r *ServiceListRequest) GetLimit() int
func (*ServiceListRequest) GetOffset ¶
func (r *ServiceListRequest) GetOffset() int
func (*ServiceListRequest) GetTag_ids ¶
func (r *ServiceListRequest) GetTag_ids() []int
type ServiceListResponse ¶
type ServiceListResponse struct { Services []*Service `json:"services"` Offset int `json:"offset"` Limit int `json:"limit"` Total int `json:"total"` }
ServiceListResponse
func (*ServiceListResponse) GetLimit ¶
func (r *ServiceListResponse) GetLimit() int
func (*ServiceListResponse) GetOffset ¶
func (r *ServiceListResponse) GetOffset() int
func (*ServiceListResponse) GetServices ¶
func (r *ServiceListResponse) GetServices() []*Service
func (*ServiceListResponse) GetTotal ¶
func (r *ServiceListResponse) GetTotal() int
type ServiceSearchRequest ¶
type ServiceSearchRequest struct { Tag_ids []int `json:"tag_ids"` Prefix string `json:"prefix"` Env_id int `json:"env_id"` Offset int `json:"offset"` Limit int `json:"limit"` }
ServiceSearchRequest
func (*ServiceSearchRequest) GetEnv_id ¶
func (r *ServiceSearchRequest) GetEnv_id() int
func (*ServiceSearchRequest) GetLimit ¶
func (r *ServiceSearchRequest) GetLimit() int
func (*ServiceSearchRequest) GetOffset ¶
func (r *ServiceSearchRequest) GetOffset() int
func (*ServiceSearchRequest) GetPrefix ¶
func (r *ServiceSearchRequest) GetPrefix() string
func (*ServiceSearchRequest) GetTag_ids ¶
func (r *ServiceSearchRequest) GetTag_ids() []int
func (ServiceSearchRequest) Validate ¶
func (r ServiceSearchRequest) Validate() *ValidateError
type TagListResponse ¶
type TagListResponse struct {
Tags []*Tag `json:"tags"`
}
TagListResponse
func (*TagListResponse) GetTags ¶
func (r *TagListResponse) GetTags() []*Tag
type UpdateServiceRequest ¶
type UpdateServiceRequest struct { Service_id int `json:"service_id"` Tags []*Tag `json:"tags"` Desc string `json:"desc"` }
UpdateServiceRequest
func (*UpdateServiceRequest) GetDesc ¶
func (r *UpdateServiceRequest) GetDesc() string
func (*UpdateServiceRequest) GetService_id ¶
func (r *UpdateServiceRequest) GetService_id() int
func (*UpdateServiceRequest) GetTags ¶
func (r *UpdateServiceRequest) GetTags() []*Tag
type UpdateServiceResponse ¶
type UpdateServiceResponse struct { Service_id int `json:"service_id"` Tags []*Tag `json:"tags"` Desc string `json:"desc"` }
UpdateServiceResponse
func (*UpdateServiceResponse) GetDesc ¶
func (r *UpdateServiceResponse) GetDesc() string
func (*UpdateServiceResponse) GetService_id ¶
func (r *UpdateServiceResponse) GetService_id() int
func (*UpdateServiceResponse) GetTags ¶
func (r *UpdateServiceResponse) GetTags() []*Tag
type UploadProtoFileRequest ¶
type UploadProtoFileRequest struct { Service_id int `json:"service_id"` Env_id int `json:"env_id"` File string `json:"file"` }
UploadProtoFileRequest
func (*UploadProtoFileRequest) GetEnv_id ¶
func (r *UploadProtoFileRequest) GetEnv_id() int
func (*UploadProtoFileRequest) GetFile ¶
func (r *UploadProtoFileRequest) GetFile() string
func (*UploadProtoFileRequest) GetService_id ¶
func (r *UploadProtoFileRequest) GetService_id() int
type UploadProtoFileResponse ¶
type UploadProtoFileResponse struct { Service_id int `json:"service_id"` Env_id int `json:"env_id"` Key_count int `json:"key_count"` }
UploadProtoFileResponse
func (*UploadProtoFileResponse) GetEnv_id ¶
func (r *UploadProtoFileResponse) GetEnv_id() int
func (*UploadProtoFileResponse) GetKey_count ¶
func (r *UploadProtoFileResponse) GetKey_count() int
func (*UploadProtoFileResponse) GetService_id ¶
func (r *UploadProtoFileResponse) GetService_id() int
type ValidateError ¶
type ValidateError struct {
Errors []*FieldError `json:"errors"`
}
ValidateError
func (*ValidateError) GetErrors ¶
func (r *ValidateError) GetErrors() []*FieldError
type ValidateErrorType ¶
type ValidateErrorType int
const ( INVALID_EMAIL ValidateErrorType = 0 FIELD_REQUIRED ValidateErrorType = 1 )
func (ValidateErrorType) Code ¶
func (code ValidateErrorType) Code() int
func (ValidateErrorType) IsFIELD_REQUIRED ¶
func (code ValidateErrorType) IsFIELD_REQUIRED() bool
func (ValidateErrorType) IsINVALID_EMAIL ¶
func (code ValidateErrorType) IsINVALID_EMAIL() bool
func (ValidateErrorType) String ¶
func (code ValidateErrorType) String() string
Source Files ¶
- AppServiceBase.go
- AuthError.go
- BindError.go
- CommonError.go
- Empty.go
- Env.go
- EnvListRequest.go
- EnvListResponse.go
- Error.go
- ErrorCode.go
- FieldError.go
- GenericError.go
- KVHistoryItem.go
- KVHistoryRequest.go
- KVHistoryResponse.go
- Key.go
- KeyListRequest.go
- KeyListResponse.go
- KeyValue.go
- KeyValueListRequest.go
- KeyValueListResponse.go
- KeyValueRequest.go
- KeyValueResponse.go
- Product.go
- ProductListRequest.go
- ProductListResponse.go
- RegisterServiceRequest.go
- RegisterServiceResponse.go
- SearchKeyValueListRequest.go
- Service.go
- ServiceListRequest.go
- ServiceListResponse.go
- ServiceSearchRequest.go
- Tag.go
- TagListRequest.go
- TagListResponse.go
- UpdateServiceRequest.go
- UpdateServiceResponse.go
- UploadProtoFileRequest.go
- UploadProtoFileResponse.go
- ValidateError.go
- ValidateErrorType.go