Skip to content

Sander0542/nginxproxymanager-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go API client for nginxproxymanager

No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)

Overview

This API client was generated by the OpenAPI Generator project. By using the OpenAPI-spec from a remote server, you can easily generate an API client.

  • API version: 2.12.2
  • Package version: 1.0.0
  • Generator version: 7.11.0
  • Build package: org.openapitools.codegen.languages.GoClientCodegen

Installation

Install the following dependencies:

go get github.com/stretchr/testify/assert
go get golang.org/x/net/context

Put the package under your project folder and add the following in import:

import nginxproxymanager "github.com/sander0542/nginxproxymanager-go"

To use a proxy, set the environment variable HTTP_PROXY:

os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port")

Configuration of Server URL

Default configuration comes with Servers field that contains server objects as defined in the OpenAPI specification.

Select Server Configuration

For using other server than the one defined on index 0 set context value nginxproxymanager.ContextServerIndex of type int.

ctx := context.WithValue(context.Background(), nginxproxymanager.ContextServerIndex, 1)

Templated Server URL

Templated server URL is formatted using default variables from configuration or from context value nginxproxymanager.ContextServerVariables of type map[string]string.

ctx := context.WithValue(context.Background(), nginxproxymanager.ContextServerVariables, map[string]string{
	"basePath": "v2",
})

Note, enum values are always validated and all unused variables are silently ignored.

URLs Configuration per Operation

Each operation can use different server URL defined using OperationServers map in the Configuration. An operation is uniquely identified by "{classname}Service.{nickname}" string. Similar rules for overriding default operation server index and variables applies by using nginxproxymanager.ContextOperationServerIndices and nginxproxymanager.ContextOperationServerVariables context maps.

ctx := context.WithValue(context.Background(), nginxproxymanager.ContextOperationServerIndices, map[string]int{
	"{classname}Service.{nickname}": 2,
})
ctx = context.WithValue(context.Background(), nginxproxymanager.ContextOperationServerVariables, map[string]map[string]string{
	"{classname}Service.{nickname}": {
		"port": "8443",
	},
})

Documentation for API Endpoints

All URIs are relative to http://localhost/api

Class Method HTTP request Description
AccessListsAPI CreateAccessList Post /nginx/access-lists Create a Access List
AccessListsAPI DeleteAccessList Delete /nginx/access-lists/{listID} Delete a Access List
AccessListsAPI GetAccessList Get /nginx/access-lists/{listID} Get a access List
AccessListsAPI GetAccessLists Get /nginx/access-lists Get all access lists
AccessListsAPI UpdateAccessList Put /nginx/access-lists/{listID} Update a Access List
AuditLogAPI GetAuditLog Get /audit-log Get Audit Log
CertificatesAPI CreateCertificate Post /nginx/certificates Create a Certificate
CertificatesAPI DeleteCertificate Delete /nginx/certificates/{certID} Delete a Certificate
CertificatesAPI DownloadCertificate Get /nginx/certificates/{certID}/download Downloads a Certificate
CertificatesAPI GetCertificate Get /nginx/certificates/{certID} Get a Certificate
CertificatesAPI GetCertificates Get /nginx/certificates Get all certificates
CertificatesAPI RenewCertificate Post /nginx/certificates/{certID}/renew Renews a Certificate
CertificatesAPI TestHttpReach Get /nginx/certificates/test-http Test HTTP Reachability
CertificatesAPI UploadCertificate Post /nginx/certificates/{certID}/upload Uploads a custom Certificate
CertificatesAPI ValidateCertificates Post /nginx/certificates/validate Validates given Custom Certificates
Class404HostsAPI Create404Host Post /nginx/dead-hosts Create a 404 Host
Class404HostsAPI DeleteDeadHost Delete /nginx/dead-hosts/{hostID} Delete a 404 Host
Class404HostsAPI DisableDeadHost Post /nginx/dead-hosts/{hostID}/disable Disable a 404 Host
Class404HostsAPI EnableDeadHost Post /nginx/dead-hosts/{hostID}/enable Enable a 404 Host
Class404HostsAPI GetDeadHost Get /nginx/dead-hosts/{hostID} Get a 404 Host
Class404HostsAPI GetDeadHosts Get /nginx/dead-hosts Get all 404 hosts
Class404HostsAPI UpdateDeadHost Put /nginx/dead-hosts/{hostID} Update a 404 Host
ProxyHostsAPI CreateProxyHost Post /nginx/proxy-hosts Create a Proxy Host
ProxyHostsAPI DeleteProxyHost Delete /nginx/proxy-hosts/{hostID} Delete a Proxy Host
ProxyHostsAPI DisableProxyHost Post /nginx/proxy-hosts/{hostID}/disable Disable a Proxy Host
ProxyHostsAPI EnableProxyHost Post /nginx/proxy-hosts/{hostID}/enable Enable a Proxy Host
ProxyHostsAPI GetProxyHost Get /nginx/proxy-hosts/{hostID} Get a Proxy Host
ProxyHostsAPI GetProxyHosts Get /nginx/proxy-hosts Get all proxy hosts
ProxyHostsAPI UpdateProxyHost Put /nginx/proxy-hosts/{hostID} Update a Proxy Host
PublicAPI Health Get / Returns the API health status
PublicAPI Schema Get /schema Returns this swagger API schema
RedirectionHostsAPI CreateRedirectionHost Post /nginx/redirection-hosts Create a Redirection Host
RedirectionHostsAPI DeleteRedirectionHost Delete /nginx/redirection-hosts/{hostID} Delete a Redirection Host
RedirectionHostsAPI DisableRedirectionHost Post /nginx/redirection-hosts/{hostID}/disable Disable a Redirection Host
RedirectionHostsAPI EnableRedirectionHost Post /nginx/redirection-hosts/{hostID}/enable Enable a Redirection Host
RedirectionHostsAPI GetRedirectionHost Get /nginx/redirection-hosts/{hostID} Get a Redirection Host
RedirectionHostsAPI GetRedirectionHosts Get /nginx/redirection-hosts Get all Redirection hosts
RedirectionHostsAPI UpdateRedirectionHost Put /nginx/redirection-hosts/{hostID} Update a Redirection Host
ReportsAPI ReportsHosts Get /reports/hosts Report on Host Statistics
SettingsAPI GetSetting Get /settings/{settingID} Get a setting
SettingsAPI GetSettings Get /settings Get all settings
SettingsAPI UpdateSetting Put /settings/{settingID} Update a setting
StreamsAPI CreateStream Post /nginx/streams Create a Stream
StreamsAPI DeleteStream Delete /nginx/streams/{streamID} Delete a Stream
StreamsAPI DisableStream Post /nginx/streams/{streamID}/disable Disable a Stream
StreamsAPI EnableStream Post /nginx/streams/{streamID}/enable Enable a Stream
StreamsAPI GetStream Get /nginx/streams/{streamID} Get a Stream
StreamsAPI GetStreams Get /nginx/streams Get all streams
StreamsAPI UpdateStream Put /nginx/streams/{streamID} Update a Stream
TokensAPI RefreshToken Get /tokens Refresh your access token
TokensAPI RequestToken Post /tokens Request a new access token from credentials
UsersAPI CreateUser Post /users Create a User
UsersAPI DeleteUser Delete /users/{userID} Delete a User
UsersAPI GetUser Get /users/{userID} Get a user
UsersAPI GetUsers Get /users Get all users
UsersAPI LoginAsUser Post /users/{userID}/login Login as this user
UsersAPI UpdateUser Put /users/{userID} Update a User
UsersAPI UpdateUserAuth Put /users/{userID}/auth Update a User's Authentication
UsersAPI UpdateUserPermissions Put /users/{userID}/permissions Update a User's Permissions

Documentation For Models

Documentation For Authorization

Authentication schemes defined for the API:

bearerAuth

  • Type: HTTP Bearer token authentication

Example

auth := context.WithValue(context.Background(), nginxproxymanager.ContextAccessToken, "BEARER_TOKEN_STRING")
r, err := client.Service.Operation(auth, args)

Documentation for Utility Methods

Due to the fact that model structure members are all pointers, this package contains a number of utility functions to easily obtain pointers to values of basic types. Each of these functions takes a value of the given basic type and returns a pointer to it:

  • PtrBool
  • PtrInt
  • PtrInt32
  • PtrInt64
  • PtrFloat
  • PtrFloat32
  • PtrFloat64
  • PtrString
  • PtrTime

Author

About

Golang SDK for nginxproxymanager

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages