diff --git a/docs/docs.go b/docs/docs.go new file mode 100644 index 0000000..9c14e73 --- /dev/null +++ b/docs/docs.go @@ -0,0 +1,129 @@ +// Package docs Code generated by swaggo/swag. DO NOT EDIT +package docs + +import "github.com/swaggo/swag" + +const docTemplate = `{ + "schemes": {{ marshal .Schemes }}, + "swagger": "2.0", + "info": { + "description": "{{escape .Description}}", + "title": "{{.Title}}", + "termsOfService": "http://nkode.example.com/terms/", + "contact": { + "name": "API Support", + "url": "http://nkode.example.com/support", + "email": "support@nkode.example.com" + }, + "license": { + "name": "MIT", + "url": "https://opensource.org/licenses/MIT" + }, + "version": "{{.Version}}" + }, + "host": "{{.Host}}", + "basePath": "{{.BasePath}}", + "paths": { + "/create-new-customer": { + "post": { + "description": "Creates a new customer based on the provided policy information.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "customers" + ], + "summary": "Create a new customer", + "parameters": [ + { + "description": "Customer creation data", + "name": "NewCustomerPost", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/core.NewCustomerPost" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/core.CreateNewCustomerResp" + } + } + } + } + } + }, + "definitions": { + "core.CreateNewCustomerResp": { + "type": "object", + "properties": { + "customer_id": { + "type": "string" + } + } + }, + "core.NKodePolicy": { + "type": "object", + "properties": { + "distinct_attributes": { + "type": "integer" + }, + "distinct_sets": { + "type": "integer" + }, + "expiration": { + "description": "seconds, -1 no expiration", + "type": "integer" + }, + "lock_out": { + "type": "integer" + }, + "max_nkode_len": { + "type": "integer" + }, + "min_nkode_len": { + "type": "integer" + } + } + }, + "core.NewCustomerPost": { + "type": "object", + "properties": { + "nkode_policy": { + "$ref": "#/definitions/core.NKodePolicy" + } + } + } + }, + "securityDefinitions": { + "ApiKeyAuth": { + "type": "apiKey", + "name": "Authorization", + "in": "header" + } + } +}` + +// SwaggerInfo holds exported Swagger Info so clients can modify it +var SwaggerInfo = &swag.Spec{ + Version: "1.0", + Host: "localhost:8080", + BasePath: "/", + Schemes: []string{}, + Title: "NKode API", + Description: "This is the NKode API server.", + InfoInstanceName: "swagger", + SwaggerTemplate: docTemplate, + LeftDelim: "{{", + RightDelim: "}}", +} + +func init() { + swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo) +} diff --git a/docs/swagger.json b/docs/swagger.json new file mode 100644 index 0000000..f20661e --- /dev/null +++ b/docs/swagger.json @@ -0,0 +1,105 @@ +{ + "swagger": "2.0", + "info": { + "description": "This is the NKode API server.", + "title": "NKode API", + "termsOfService": "http://nkode.example.com/terms/", + "contact": { + "name": "API Support", + "url": "http://nkode.example.com/support", + "email": "support@nkode.example.com" + }, + "license": { + "name": "MIT", + "url": "https://opensource.org/licenses/MIT" + }, + "version": "1.0" + }, + "host": "localhost:8080", + "basePath": "/", + "paths": { + "/create-new-customer": { + "post": { + "description": "Creates a new customer based on the provided policy information.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "customers" + ], + "summary": "Create a new customer", + "parameters": [ + { + "description": "Customer creation data", + "name": "NewCustomerPost", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/core.NewCustomerPost" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/core.CreateNewCustomerResp" + } + } + } + } + } + }, + "definitions": { + "core.CreateNewCustomerResp": { + "type": "object", + "properties": { + "customer_id": { + "type": "string" + } + } + }, + "core.NKodePolicy": { + "type": "object", + "properties": { + "distinct_attributes": { + "type": "integer" + }, + "distinct_sets": { + "type": "integer" + }, + "expiration": { + "description": "seconds, -1 no expiration", + "type": "integer" + }, + "lock_out": { + "type": "integer" + }, + "max_nkode_len": { + "type": "integer" + }, + "min_nkode_len": { + "type": "integer" + } + } + }, + "core.NewCustomerPost": { + "type": "object", + "properties": { + "nkode_policy": { + "$ref": "#/definitions/core.NKodePolicy" + } + } + } + }, + "securityDefinitions": { + "ApiKeyAuth": { + "type": "apiKey", + "name": "Authorization", + "in": "header" + } + } +} \ No newline at end of file diff --git a/docs/swagger.yaml b/docs/swagger.yaml new file mode 100644 index 0000000..fb0b9dd --- /dev/null +++ b/docs/swagger.yaml @@ -0,0 +1,70 @@ +basePath: / +definitions: + core.CreateNewCustomerResp: + properties: + customer_id: + type: string + type: object + core.NKodePolicy: + properties: + distinct_attributes: + type: integer + distinct_sets: + type: integer + expiration: + description: seconds, -1 no expiration + type: integer + lock_out: + type: integer + max_nkode_len: + type: integer + min_nkode_len: + type: integer + type: object + core.NewCustomerPost: + properties: + nkode_policy: + $ref: '#/definitions/core.NKodePolicy' + type: object +host: localhost:8080 +info: + contact: + email: support@nkode.example.com + name: API Support + url: http://nkode.example.com/support + description: This is the NKode API server. + license: + name: MIT + url: https://opensource.org/licenses/MIT + termsOfService: http://nkode.example.com/terms/ + title: NKode API + version: "1.0" +paths: + /create-new-customer: + post: + consumes: + - application/json + description: Creates a new customer based on the provided policy information. + parameters: + - description: Customer creation data + in: body + name: NewCustomerPost + required: true + schema: + $ref: '#/definitions/core.NewCustomerPost' + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/core.CreateNewCustomerResp' + summary: Create a new customer + tags: + - customers +securityDefinitions: + ApiKeyAuth: + in: header + name: Authorization + type: apiKey +swagger: "2.0"