github.com/josephspurrier/go-swagger@v0.2.1-0.20221129144919-1f672a142a00/fixtures/goparsing/go119/golangnuts.go (about)

     1  package go119
     2  
     3  import (
     4  	"net/http"
     5  )
     6  
     7  // The some func was taken from: https://groups.google.com/g/golang-nuts/c/sY7QFzfSMT4/m/Rk6WVRJEAQAJ
     8  
     9  // SomeFunc do something
    10  //
    11  // swagger:operation POST /api/v1/somefunc someFunc
    12  //
    13  // Do something
    14  //
    15  //	---
    16  //	x-codeSamples:
    17  //	- lang: 'curl'
    18  //	  source: |
    19  //	    curl -u "${LOGIN}:${PASSWORD}" -d '{"key": "value"}' -X POST   "https://{host}/api/v1/somefunc"
    20  //	    curl -u "${LOGIN}:${PASSWORD}" -d '{"key2": "value2"}' -X POST   "https://{host}/api/v1/somefunc"
    21  //	responses:
    22  //	  '200':
    23  //	    description: "Some func"
    24  //	    examples:
    25  //	      application/json:
    26  //	        key: "value"
    27  //	  '400':
    28  //	    $ref: "#/responses/ErrorResponse"
    29  //	  '503':
    30  //	    $ref: "#/responses/ErrorResponse"
    31  func SomeFunct(rw http.ResponseWriter, req *http.Request) {
    32  	/// do something
    33  }
    34  
    35  // SomeFunc do something
    36  //
    37  // swagger:operation POST /api/v1/somefuncTabs someFuncTabs
    38  //
    39  // Do something
    40  //
    41  //	---
    42  //	x-codeSamples:
    43  //	- lang: 'curl'
    44  //		source: |
    45  //			curl -u "${LOGIN}:${PASSWORD}" -d '{"key": "value"}' -X POST   "https://{host}/api/v1/somefunc"
    46  //			curl -u "${LOGIN}:${PASSWORD}" -d '{"key2": "value2"}' -X POST   "https://{host}/api/v1/somefunc"
    47  //	responses:
    48  //		'200':
    49  //			description: "Some func"
    50  //			examples:
    51  //				application/json:
    52  //					key: "value"
    53  //		'400':
    54  //			$ref: "#/responses/ErrorResponse"
    55  //		'503':
    56  //			$ref: "#/responses/ErrorResponse"
    57  func SomeFunctabs(rw http.ResponseWriter, req *http.Request) {
    58  	/// do something
    59  }