hiboot: hidevops.io/hiboot/pkg/at Index | Files

package at

import "hidevops.io/hiboot/pkg/at"

Package at provides annotations for struct, function, or method

Package at provides annotations for web RestController

Copyright 2018~now John Deng (hi.devops.io@gmail.com).

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Package Files

annotation.go application.go component.go conditional.go configuration.go contextaware.go doc.go healthcheck.go middleware.go qualifier.go request.go response.go restcontroller.go swagger.go tag.go

type AfterMethod Uses

type AfterMethod struct {
    Annotation

    HttpMethod
}

AfterMethod is the annotation that set the called after the http method of a controller

type Annotation Uses

type Annotation struct {
}

Annotation is an empty struct that indicates the struct as an annotation

type AnyMapping Uses

type AnyMapping struct {
    Annotation

    RequestMapping
    AtMethod string `value:"ANY" at:"method" json:"-"`
}

AnyMapping is the annotation that set the AnyMapping of a controller

type AutoConfiguration Uses

type AutoConfiguration struct {
    Annotation

    BaseAnnotation
}

AutoConfiguration is the annotation of auto configuration

type BaseAnnotation Uses

type BaseAnnotation struct {
    Annotation `json:"-"`

    AtValue string `json:"-" at:"value"`
}

BaseAnnotation is the base of an annotation

type BeforeMethod Uses

type BeforeMethod struct {
    Annotation

    HttpMethod
}

BeforeMethod is the annotation that set the called before the http method of a controller

type Component Uses

type Component struct {
    Annotation

    BaseAnnotation
}

Component is the annotation that the dependency is injected in app init.

type Conditional Uses

type Conditional struct {
    Annotation

    BaseAnnotation
}

Conditional annotation

type ConfigurationProperties Uses

type ConfigurationProperties struct {
    Annotation

    BaseAnnotation
}

ConfigurationProperties is the annotation that annotate configuration properties

type Consumes Uses

type Consumes struct {
    Annotation

    Swagger

    AtValues []string `at:"values" json:"-"`
}

Consumes corresponds to the `consumes` field of the operation. Takes in comma-separated values of content types. For example, "application/json, application/xml" would suggest this API Resource accepts JSON and XML input. example: at struct {

at.Consumes    `values:"application/json,application/xml"`

}

type ContextAware Uses

type ContextAware struct {
    Annotation

    BaseAnnotation
}

ContextAware is the annotation that it is the ability of a component to be injected when method of Rest Controller is requested. type Example struct {

at.ContextAware
...

}

type ContextPath Uses

type ContextPath struct {
    Annotation

    BaseAnnotation
}

ContextPath is the annotation that set the context path of a controller

type DeleteMapping Uses

type DeleteMapping struct {
    Annotation

    RequestMapping
    AtMethod string `method:"DELETE" at:"method" json:"-"`
}

DeleteMapping is the annotation that set the DeleteMapping of a controller

type ExternalDocs Uses

type ExternalDocs struct {
    Annotation

    Swagger

    AtDescription string `at:"description" json:"-"`
    AtURL         string `at:"url" json:"-"`
}

ExternalDocs

type FileServer Uses

type FileServer struct {
    Annotation

    RequestMapping
}

StaticResource is the annotation that set the StaticResource of a controller value: static resource dir

type GetMapping Uses

type GetMapping struct {
    Annotation

    RequestMapping
    AtMethod string `method:"GET" at:"method" json:"-"`
}

GetMapping is the annotation that set the GetMapping of a controller

type Header struct {
    Annotation

    Swagger

    AtType        string `at:"type" json:"-"`
    AtFormat      string `at:"format" json:"-"`
    AtDescription string `at:"description" json:"-"`
}

Header is the annotation that annotate the header

type HealthCheckService Uses

type HealthCheckService struct {
    Annotation

    BaseAnnotation
}

HealthCheckService is the annotation for health check service

type HiBootApplication Uses

type HiBootApplication struct {
    Annotation

    BaseAnnotation
}

HiBootApplication

type HttpMethod Uses

type HttpMethod struct {
    Annotation

    BaseAnnotation
}

HttpMethod is the annotation that the http method of a controller

type HttpMethodSubscriber Uses

type HttpMethodSubscriber struct {
    Annotation

    BaseAnnotation
}

type JwtRestController Uses

type JwtRestController struct {
    Annotation

    RestController
    UseJwt
}

JwtRestController is the annotation that declare current controller is the RESTful Controller with JWT support

type Method Uses

type Method struct {
    Annotation

    BaseAnnotation
}

Method is the annotation that set the RequestMethod of a controller

type Middleware Uses

type Middleware struct {
    Annotation

    BaseAnnotation
}

Middleware is the annotation that annotate the controller or method use middleware

type MiddlewareHandler Uses

type MiddlewareHandler struct {
    Annotation

    BaseAnnotation
}

MiddlewareHandler is the annotation that annotate the controller or method use middleware

type Operation Uses

type Operation struct {
    Annotation

    Swagger

    AtID          string `at:"id" json:"-"`
    AtDescription string `at:"description" json:"-"`
    AtSummary     string `at:"summary" json:"-"`
    AtDeprecated  bool   `at:"deprecated" json:"-"`
}

Operation Describes an operation or typically a HTTP method against a specific path. Operations with equivalent paths are grouped in a single Operation Object. A combination of a HTTP method and a path creates a unique operation. example: func (c *) CreateEmployee(at struct{

  at.PostMapping `value:"/"`
  at.Operation   `id:"Create Employee" description:"This is the employee creation api"`
}, request EmployeeRequest) {

...

}

type OptionsMapping Uses

type OptionsMapping struct {
    Annotation

    RequestMapping
    AtMethod string `method:"OPTIONS" at:"method" json:"-"`
}

OptionsMapping is the annotation that set the OptionsMapping of a controller

type Parameter Uses

type Parameter struct {
    Annotation

    Swagger

    AtName        string `at:"name" json:"-"`
    AtType        string `at:"type" json:"-"`
    AtIn          string `at:"in" json:"-"`
    AtDescription string `at:"description" json:"-"`
}

ApiParam annotation to add additional meta-data for operation parameters func (c *) CreateEmployee(at struct{

  at.PostMapping `value:"/"`
  at.Parameter `value:"Employee object store in database table" required:"true"`
}, request EmployeeRequest) {

...

} Parameter

type PatchMapping Uses

type PatchMapping struct {
    Annotation

    RequestMapping
    AtMethod string `method:"PATCH" at:"method" json:"-"`
}

PatchMapping is the annotation that set the PatchMapping of a controller

type PathVariable Uses

type PathVariable struct {
    Annotation

    BaseAnnotation
}

PathVariable the annotation PathVariable

type PostMapping Uses

type PostMapping struct {
    Annotation

    RequestMapping
    AtMethod string `method:"POST" at:"method" json:"-"`
}

PostMapping is the annotation that set the PostMapping of a controller

type Produces Uses

type Produces struct {
    Annotation

    Swagger

    AtValues []string `at:"values" json:"-"`
}

Produces corresponds to the `produces` field of the operation. Takes in comma-separated values of content types. For example, "application/json, application/xml" would suggest this operation generates JSON and XML output. example: at struct {

at.Consumes    `values:"application/json,application/xml"`

}

type PutMapping Uses

type PutMapping struct {
    Annotation

    RequestMapping
    AtMethod string `method:"PUT" at:"method" json:"-"`
}

PutMapping is the annotation that set the PutMapping of a controller

type Qualifier Uses

type Qualifier struct {
    Annotation

    BaseAnnotation
}

Qualifier is the annotation that used for disambiguate the references.

type RequestBody Uses

type RequestBody struct {
    Annotation

    BaseAnnotation
}

RequestBody the annotation RequestBody

type RequestForm Uses

type RequestForm struct {
    Annotation

    BaseAnnotation
}

RequestForm the annotation RequestForm

type RequestMapping Uses

type RequestMapping struct {
    Annotation

    HttpMethod
}

RequestMapping is the annotation that set the RequestMapping of a controller

type RequestParams Uses

type RequestParams struct {
    Annotation

    BaseAnnotation
}

RequestParams the annotation RequestParams

type Response Uses

type Response struct {
    Annotation

    Swagger

    AtCode        int    `at:"code" json:"-"`
    AtDescription string `at:"description" json:"-"`
}

Response is the response type of the operation. example: Responses struct {

StatusOK struct {
	at.Response `code:"200" description:"returns a greeting"`
	at.Schema   `type:"string" description:"contains the actual greeting as plain text"`
}
StatusNotFound struct {
	at.Response `code:"404" description:"greeter is not available"`
	at.Schema   `type:"string" description:"Report 'not found' error message"`
}

}

type ResponseBody Uses

type ResponseBody struct {
    Annotation

    BaseAnnotation
}

ResponseBody the annotation ResponseBody

type ResponseData Uses

type ResponseData struct {
    Annotation

    BaseAnnotation
}

ResponseData the annotation ResponseData

type RestController Uses

type RestController struct {
    Annotation

    BaseAnnotation
}

RestController is the annotation that declare current controller is the RESTful Controller

type Schema Uses

type Schema struct {
    Annotation

    Swagger

    AtType        string `at:"type" json:"-"`
    AtDescription string `at:"description" json:"-"`
}

Schema is the annotation that annotate Response or Parameter's properties example: Responses struct {

StatusOK struct {
	at.Response `code:"200" description:"returns a greeting"`
	at.Schema   `type:"string" description:"contains the actual greeting as plain text"`
}
StatusNotFound struct {
	at.Response `code:"404" description:"greeter is not available"`
	at.Schema   `type:"string" description:"Report 'not found' error message"`
}

}

type Swagger Uses

type Swagger struct {
    Annotation

    BaseAnnotation
}

Swagger is the annotation group - swagger

type Tag Uses

type Tag struct {
    Annotation

    BaseAnnotation
}

Tag the annotation Tag, tell the injector that the struct implements a tag

type Tags Uses

type Tags struct {
    Annotation

    Swagger

    AtValues []string `at:"values" json:"-"`
}

Tags

type TraceMapping Uses

type TraceMapping struct {
    Annotation

    RequestMapping
    AtMethod string `method:"TRACE" at:"method" json:"-"`
}

TraceMapping is the annotation that set the TraceMapping of a controller

type UseJwt Uses

type UseJwt struct {
    Annotation

    UseMiddleware
}

UseJwt

type UseMiddleware Uses

type UseMiddleware struct {
    Annotation

    Conditional
}

UseMiddleware is the annotation that that annotate the controller or method use middleware based on condition

Package at is imported by 46 packages. Updated 2019-10-05. Refresh now. Tools for package owners.