gokong

package module
v1.9.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 1, 2019 License: MIT Imports: 11 Imported by: 0

README

Build Status

GoKong

A kong go client fully tested with no mocks!!

Notice

As per version v1.0.0 all values are now pointer to type, this is to allow detection between setting the zero value of the type versus not setting it. For example if you want to set a string to "" this will be omitted when serializing to json if you use string so to get round this we can use *string. This is as per the way the aws go sdk does it.

GoKong

GoKong is a easy to use api client for kong. The difference with the gokong library is all of its tests are written against a real running kong running inside a docker container, yep that's right you won't see a horrible mock anywhere!!

Supported Kong Versions

As per travis build:

KONG_VERSION=0.13.0

Importing

To add gokong via go get:

go get github.com/kevholditch/gokong

To add gokong via govendor:

govendor fetch github.com/kevholditch/gokong

Usage

Import gokong

import (
  "github.com/kevholditch/gokong"
)

To create a default config for use with the client:

config := gokong.NewDefaultConfig()

NewDefaultConfig creates a config with the host address set to the value of the env variable KONG_ADMIN_ADDR. If the env variable is not set then the address is defaulted to http://localhost:8001.

There are a number of options you can set via config either by explicitly setting them when creating a config instance or by simply using the NewDefaultConfig method and using env variables. Below is a table of the fields, the env variables that can be used to set them and their default values if you do not provide one via an env variable:

Config property Env variable Default if not set Use
HostAddress KONG_ADMIN_ADDR http://localhost:8001 The url of the kong admin api
Username KONG_ADMIN_USERNAME not set Username for the kong admin api
Password KONG_ADMIN_PASSWORD not set Password for the kong admin api
InsecureSkipVerify TLS_SKIP_VERIFY false Whether to skip tls certificate verification for the kong api when using https
ApiKey KONG_API_KEY not set The api key you have used to lock down the kong admin api (via key-auth plugin)
AdminToken KONG_ADMIN_TOKEN not set The api key you have used to lock down the kong admin api (Enterprise Edition )

You can of course create your own config with the address set to whatever you want:

config := gokong.Config{HostAddress:"http://localhost:1234"}

Also you can apply Username and Password for admin-api Basic Auth:

config := gokong.Config{HostAddress:"http://localhost:1234",Username:"adminuser",Password:"yoursecret"}

If you need to ignore TLS verification, you can set InsecureSkipVerify:

config := gokong.Config{InsecureSkipVerify: true}

This might be needed if your Kong installation is using a self-signed certificate, or if you are proxying to the Kong admin port.

Getting the status of the kong server:

kongClient := gokong.NewClient(gokong.NewDefaultConfig())
status, err := kongClient.Status().Get()

Gokong is fluent so we can combine the above two lines into one:

status, err := gokong.NewClient(gokong.NewDefaultConfig()).Status().Get()

APIs

Create a new API (for more information on the API fields see the Kong documentation:

apiRequest := &gokong.ApiRequest{
  Name:                   "Example",
  Hosts:                  gokong.StringSlice([]string{"example.com"}),
  Uris:                   gokong.StringSlice([]string{"/example"}),
  Methods:                gokong.StringSlice([]string{"GET", "POST"}),
  UpstreamUrl:            gokong.String("http://localhost:4140/testservice"),
  StripUri:               gokong.Bool(true),
  PreserveHost:           gokong.Bool(true),
  Retries:                gokong.Int(3),
  UpstreamConnectTimeout: gokong.Int(1000),
  UpstreamSendTimeout:    gokong.Int(2000),
  UpstreamReadTimeout:    gokong.Int(3000),
  HttpsOnly:              gokong.Bool(true),
  HttpIfTerminated:       gokong.Bool(true),
}

api, err := gokong.NewClient(gokong.NewDefaultConfig()).Apis().Create(apiRequest)

Get an API by id:

api, err := gokong.NewClient(gokong.NewDefaultConfig()).Apis().GetById("cdf5372e-1c10-4ea5-a3dd-1e4c31bb99f5")

Get an API by name:

api, err := gokong.NewClient(gokong.NewDefaultConfig()).Apis().GetByName("Example")

List all APIs:

apis, err := gokong.NewClient(gokong.NewDefaultConfig()).Apis().List()

List all APIs with a filter:

apis, err := gokong.NewClient(gokong.NewDefaultConfig()).Apis().ListFiltered(&gokong.ApiFilter{Id:"936ad391-c30d-43db-b624-2f820d6fd38d", Name:"MyApi"})

Delete an API by id:

err := gokong.NewClient(gokong.NewDefaultConfig()).Apis().DeleteById("f138641a-a15b-43c3-bd76-7157a68eae24")

Delete an API by name:

err := gokong.NewClient(gokong.NewDefaultConfig()).Apis().DeleteByName("Example")

Update an API by id:

apiRequest := &gokong.ApiRequest{
    Name:                   "Example",
    Hosts:                  gokong.StringSlice([]string{"example.com"}),
    Uris:                   gokong.StringSlice([]string{"/example"}),
    Methods:                gokong.StringSlice([]string{"GET", "POST"}),
    UpstreamUrl:            gokong.String("http://localhost:4140/testservice"),
    StripUri:               gokong.Bool(true),
    PreserveHost:           gokong.Bool(true),
    Retries:                gokong.Int(3),
    UpstreamConnectTimeout: gokong.Int(1000),
    UpstreamSendTimeout:    gokong.Int(2000),
    UpstreamReadTimeout:    gokong.Int(3000),
    HttpsOnly:              gokong.Bool(true),
    HttpIfTerminated:       gokong.Bool(true),
}

updatedApi, err := gokong.NewClient(gokong.NewDefaultConfig()).Apis().UpdateById("1213a00d-2b12-4d65-92ad-5a02d6c710c2", apiRequest)

Update an API by name:

apiRequest := &gokong.ApiRequest{
  Name:                   "Example",
  Hosts:                  gokong.StringSlice([]string{"example.com"}),
  Uris:                   gokong.StringSlice([]string{"/example"}),
  Methods:                gokong.StringSlice([]string{"GET", "POST"}),
  UpstreamUrl:            gokong.String("http://localhost:4140/testservice"),
  StripUri:               gokong.Bool(true),
  PreserveHost:           gokong.Bool(true),
  Retries:                gokong.Int(3),
  UpstreamConnectTimeout: gokong.Int(1000),
  UpstreamSendTimeout:    gokong.Int(2000),
  UpstreamReadTimeout:    gokong.Int(3000),
  HttpsOnly:              gokong.Bool(true),
  HttpIfTerminated:       gokong.Bool(true),

updatedApi, err := gokong.NewClient(gokong.NewDefaultConfig()).Apis().UpdateByName("Example", apiRequest)

Consumers

Create a new Consumer (for more information on the Consumer Fields see the Kong documentation):

consumerRequest := &gokong.ConsumerRequest{
  Username: "User1",
  CustomId: "SomeId",
}

consumer, err := gokong.NewClient(gokong.NewDefaultConfig()).Consumers().Create(consumerRequest)

Get a Consumer by id:

consumer, err := gokong.NewClient(gokong.NewDefaultConfig()).Consumers().GetById("e8ccbf13-a662-45be-9b6a-b549cc739c18")

Get a Consumer by username:

consumer, err := gokong.NewClient(gokong.NewDefaultConfig()).Consumers().GetByUsername("User1")

List all Consumers:

consumers, err := gokong.NewClient(gokong.NewDefaultConfig()).Consumers().List()

List all Consumers with a filter:

consumers, err := gokong.NewClient(gokong.NewDefaultConfig()).Consumers().ListFiltered(&gokong.ConsumerFilter{CustomId:"1234", Username: "User1"})

Delete a Consumer by id:

err := gokong.NewClient(gokong.NewDefaultConfig()).Consumers().DeleteById("7c8741b7-3cf5-4d90-8674-b34153efbcd6")

Delete a Consumer by username:

err := gokong.NewClient(gokong.NewDefaultConfig()).Consumers().DeleteByUsername("User1")

Update a Consumer by id:

consumerRequest := &gokong.ConsumerRequest{
  Username: "User1",
  CustomId: "SomeId",
}

updatedConsumer, err := gokong.NewClient(gokong.NewDefaultConfig()).Consumers().UpdateById("44a37c3d-a252-4968-ab55-58c41b0289c2", consumerRequest)

Update a Consumer by username:

consumerRequest := &gokong.ConsumerRequest{
  Username: "User2",
  CustomId: "SomeId",
}

updatedConsumer, err := gokong.NewClient(gokong.NewDefaultConfig()).Consumers().UpdateByUsername("User2", consumerRequest)

Plugins

Create a new Plugin to be applied to all APIs and consumers do not set ApiId or ConsumerId. Not all plugins can be configured in this way (for more information on the Plugin Fields see the Kong documentation):

pluginRequest := &gokong.PluginRequest{
  Name: "response-ratelimiting",
  Config: map[string]interface{}{
    "limits.sms.minute": 20,
  },
}

createdPlugin, err := gokong.NewClient(gokong.NewDefaultConfig()).Plugins().Create(pluginRequest)

Create a new Plugin for a single API (only set ApiId), not all plugins can be configured in this way (for more information on the Plugin Fields see the Kong documentation):

client := gokong.NewClient(gokong.NewDefaultConfig())

apiRequest := &gokong.ApiRequest{
  Name:                   "test-api",
  Hosts:                  []string{"example.com"},
  Uris:                   []string{"/example"},
  Methods:                []string{"GET", "POST"},
  UpstreamUrl:            "http://localhost:4140/testservice",
  StripUri:               true,
  PreserveHost:           true,
  Retries:                "3",
  UpstreamConnectTimeout: 1000,
  UpstreamSendTimeout:    2000,
  UpstreamReadTimeout:    3000,
  HttpsOnly:              true,
  HttpIfTerminated:       true,
}

createdApi, err := client.Apis().Create(apiRequest)

pluginRequest := &gokong.PluginRequest{
  Name: "response-ratelimiting",
  ApiId: createdApi.Id,
  Config: map[string]interface{}{
    "limits.sms.minute": 20,
  },
}

createdPlugin, err := client.Plugins().Create(pluginRequest)

Create a new Plugin for a single Consumer (only set ConsumerId), Not all plugins can be configured in this way (for more information on the Plugin Fields see the Kong documentation):

client := gokong.NewClient(gokong.NewDefaultConfig())

consumerRequest := &gokong.ConsumerRequest{
  Username: "User1",
  CustomId: "test",
}

createdConsumer, err := client.Consumers().Create(consumerRequest)

pluginRequest := &gokong.PluginRequest{
  Name: "response-ratelimiting",
  ConsumerId: createdConsumer.Id,
  Config: map[string]interface{}{
    "limits.sms.minute": 20,
  },
}

createdPlugin, err := client.Plugins().Create(pluginRequest)

Create a new Plugin for a single Service (only set ServiceId), Not all plugins can be configured in this way (for more information on the Plugin Fields see the Kong documentation):

client := gokong.NewClient(gokong.NewDefaultConfig())

serviceRequest := &ServiceRequest{
  Name:     String("service"),
  Protocol: String("http"),
  Host:     String("example.com"),
}

createdService, err := client.Services().AddService(serviceRequest)

pluginRequest := &gokong.PluginRequest{
  Name: "response-ratelimiting",
  ServiceId: *createdService.Id,
  Config: map[string]interface{}{
    "limits.sms.minute": 20,
  },
}

createdPlugin, err := client.Plugins().Create(pluginRequest)

Create a new Plugin for a single Route (only set RouteId), Not all plugins can be configured in this way (for more information on the Plugin Fields see the Kong documentation):

client := gokong.NewClient(gokong.NewDefaultConfig())

serviceRequest := &ServiceRequest{
  Name:     String("service"),
  Protocol: String("http"),
  Host:     String("example.com"),
}

createdService, err := client.Services().AddService(serviceRequest)

routeRequest := &RouteRequest{
  Protocols:    StringSlice([]string{"http"}),
  Methods:      StringSlice([]string{"GET"}),
  Hosts:        StringSlice([]string{"example.com"}),
  Paths:        StringSlice([]string{"/"}),
  StripPath:    Bool(true),
  PreserveHost: Bool(false),
  Service:      &RouteServiceObject{Id: *createdService.Id},
}

createdRoute, err := client.Routes().AddRoute(routeRequest)

pluginRequest := &gokong.PluginRequest{
  Name: "response-ratelimiting",
  RouteId: *createdRoute.Id,
  Config: map[string]interface{}{
    "limits.sms.minute": 20,
  },
}

createdPlugin, err := client.Plugins().Create(pluginRequest)

Create a new Plugin for a single Consumer and Api (set ConsumerId and ApiId), Not all plugins can be configured in this way (for more information on the Plugin Fields see the Kong documentation):

client := gokong.NewClient(gokong.NewDefaultConfig())

consumerRequest := &gokong.ConsumerRequest{
  Username: "User1",
  CustomId: "test",
}

createdConsumer, err := client.Consumers().Create(consumerRequest)

apiRequest := &gokong.ApiRequest{
  Name:                   "test-api",
  Hosts:                  []string{"example.com"},
  Uris:                   []string{"/example"},
  Methods:                []string{"GET", "POST"},
  UpstreamUrl:            "http://localhost:4140/testservice",
  StripUri:               true,
  PreserveHost:           true,
  Retries:                "3",
  UpstreamConnectTimeout: 1000,
  UpstreamSendTimeout:    2000,
  UpstreamReadTimeout:    3000,
  HttpsOnly:              true,
  HttpIfTerminated:       true,
}

createdApi, err := client.Apis().Create(apiRequest)

pluginRequest := &gokong.PluginRequest{
  Name:       "response-ratelimiting",
  ConsumerId: createdConsumer.Id,
  ApiId:      createdApi.Id,
  Config: map[string]interface{}{
    "limits.sms.minute": 20,
  },
}

createdPlugin, err := client.Plugins().Create(pluginRequest)

Get a plugin by id:

plugin, err := gokong.NewClient(gokong.NewDefaultConfig()).Plugins().GetById("04bda233-d035-4b8a-8cf2-a53f3dd990f3")

List all plugins:

plugins, err := gokong.NewClient(gokong.NewDefaultConfig()).Plugins().List()

List all plugins with a filter:

plugins, err := gokong.NewClient(gokong.NewDefaultConfig()).Plugins().ListFiltered(&gokong.PluginFilter{Name: "response-ratelimiting", ConsumerId: "7009a608-b40c-4a21-9a90-9219d5fd1ac7"})

Delete a plugin by id:

err := gokong.NewClient(gokong.NewDefaultConfig()).Plugins().DeleteById("f2bbbab8-3e6f-4d9d-bada-d486600b3b4c")

Update a plugin by id:

updatePluginRequest := &gokong.PluginRequest{
  Name:       "response-ratelimiting",
  ConsumerId: createdConsumer.Id,
  ApiId:      createdApi.Id,
  Config: map[string]interface{}{
    "limits.sms.minute": 20,
  },
}

updatedPlugin, err := gokong.NewClient(gokong.NewDefaultConfig()).Plugins().UpdateById("70692eed-2293-486d-b992-db44a6459360", updatePluginRequest)

Configure a plugin for a Consumer

To configure a plugin for a consumer you can use the CreatePluginConfig, GetPluginConfig and DeletePluginConfig methods on the Consumers endpoint. Some plugins require configuration for a consumer for example the [jwt plugin[(https://getkong.org/plugins/jwt/#create-a-jwt-credential).

Create a plugin config for a consumer:

createdPluginConfig, err := gokong.NewClient(gokong.NewDefaultConfig()).Consumers().CreatePluginConfig("f6539872-d8c5-4d6c-a2f2-923760329e4e", "jwt", "{\"key\": \"a36c3049b36249a3c9f8891cb127243c\"}")

Get a plugin config for a consumer by plugin config id:

pluginConfig, err := gokong.NewClient(gokong.NewDefaultConfig()).Consumers().GetPluginConfig("58c5229-dc92-4632-91c1-f34d9b84db0b", "jwt", "22700b52-ba59-428e-b03b-ba429b1e775e")

Delete a plugin config for a consumer by plugin config id:

err := gokong.NewClient(gokong.NewDefaultConfig()).Consumers().DeletePluginConfig("3958a860-ceac-4a6c-9bbb-ff8d69a585d2", "jwt", "bde04c3a-46bb-45c9-9006-e8af20d04342")

Certificates

Create a Certificate (for more information on the Certificate Fields see the Kong documentation):

certificateRequest := &gokong.CertificateRequest{
  Cert: gokong.String("public key --- 123"),
  Key:  gokong.String("private key --- 456"),
}

createdCertificate, err := gokong.NewClient(gokong.NewDefaultConfig()).Certificates().Create(certificateRequest)

Get a Certificate by id:

certificate, err := gokong.NewClient(gokong.NewDefaultConfig()).Certificates().GetById("0408cbd4-e856-4565-bc11-066326de9231")

List all certificates:

certificates, err := gokong.NewClient(gokong.NewDefaultConfig()).Certificates().List()

Delete a Certificate:

err := gokong.NewClient(gokong.NewDefaultConfig()).Certificates().DeleteById("db884cf2-9dd7-4e33-9ef5-628165076a42")

Update a Certificate:

updateCertificateRequest := &gokong.CertificateRequest{
  Cert: gokong.String("public key --- 789"),
  Key:  gokong.String("private key --- 111"),
}

updatedCertificate, err := gokong.NewClient(gokong.NewDefaultConfig()).Certificates().UpdateById("1dc11281-30a6-4fb9-aec2-c6ff33445375", updateCertificateRequest)

Routes

Create a Route (for more information on the Route Fields see the Kong documentation):

serviceRequest := &gokong.ServiceRequest{
  Name:     gokong.String("service-name" + uuid.NewV4().String()),
  Protocol: gokong.String("http"),
  Host:     gokong.String("foo.com"),
}

client := gokong.NewClient(NewDefaultConfig())

createdService, err := client.Services().AddService(serviceRequest)

routeRequest := &RouteRequest{
  Protocols:    gokong.StringSlice([]string{"http"}),
  Methods:      gokong.StringSlice([]string{"GET"}),
  Hosts:        gokong.StringSlice([]string{"foo.com"}),
  StripPath:    gokong.Bool(true),
  PreserveHost: gokong.Bool(true),
  Service:      &RouteServiceObject{Id: *createdService.Id},
  Paths:        gokong.StringSlice([]string{"/bar"})
}

createdRoute, err := client.Routes().AddRoute(routeRequest)

Get a route by ID:

result, err := gokong.NewClient(gokong.NewDefaultConfig()).Routes().GetRoute(createdRoute.Id)

Get all routes:

result, err := gokong.NewClient(gokong.NewDefaultConfig()).Routes().GetRoutes(&RouteQueryString{})

Get routes from service ID or Name:

result, err := gokong.NewClient(gokong.NewDefaultConfig()).Routes().GetRoutesFromServiceId(createdService.Id)

Update a route:

routeRequest := &RouteRequest{
  Protocols:    gokong.StringSlice([]string{"http"}),
  Methods:      gokong.StringSlice([]string{"GET"}),
  Hosts:        gokong.StringSlice([]string{"foo.com"}),
  Paths:        gokong.StringSlice([]string{"/bar"}),
  StripPath:    gokong.Bool(true),
  PreserveHost: gokong.Bool(true),
  Service:      &RouteServiceObject{Id: *createdService.Id},
}

createdRoute, err := gokong.NewClient(gokong.NewDefaultConfig()).Routes().AddRoute(routeRequest)

routeRequest.Paths = gokong.StringSlice([]string{"/qux"})
updatedRoute, err := gokong.NewClient(gokong.NewDefaultConfig()).Routes().UpdateRoute(*createdRoute.Id, routeRequest)

Delete a route:

client.Routes().DeleteRoute(createdRoute.Id)

Services

Create an Service (for more information on the Service Fields see the Kong documentation):

serviceRequest := &ServiceRequest{
		Name:     gokong.String("service-name-0"),
		Protocol: gokong.String("http"),
		Host:     gokong.String("foo.com"),
	}

	client := gokong.NewClient(gokong.NewDefaultConfig())

	createdService, err := client.Services().AddService(serviceRequest)

Get information about a service with the service ID or Name

serviceRequest := &ServiceRequest{
		Name:     gokong.String("service-name-0"),
    Protocol: gokong.String("http"),
    Host:     gokong.String("foo.com")
	}

client := gokong.NewClient(gokong.NewDefaultConfig())

createdService, err := client.Services().AddService(serviceRequest)

resultFromId, err := client.Services().GetServiceById(createdService.Id)

resultFromName, err := client.Services().GetServiceByName(createdService.Id)

Get information about a service with the route ID

result, err := gokong.NewClient(gokong.NewDefaultConfig()).Services().GetServiceRouteId(routeInformation.Id)

Get many services information

result, err := gokong.NewClient(gokong.NewDefaultConfig()).Services().GetServices(&ServiceQueryString{
	Size: 500
	Offset: 300
})

Update a service with the service ID or Name

serviceRequest := &ServiceRequest{
  Name:     gokong.String("service-name-0"),
  Protocol: gokong.String("http"),
  Host:     gokong.String("foo.com"),
}

client := gokong.NewClient(gokong.NewDefaultConfig())

createdService, err := client.Services().AddService(serviceRequest)

serviceRequest.Host = gokong.String("bar.io")
updatedService, err := client.Services().UpdateServiceById(createdService.Id, serviceRequest)
result, err := client.Services().GetServiceById(createdService.Id)

Update a service by the route ID

serviceRequest := &ServiceRequest{
  Name:     gokong.String("service-name-0"),
  Protocol: gokong.String("http"),
  Host:     gokong.String("foo.com"),
}

client := gokong.NewClient(gokong.NewDefaultConfig())

createdService, err := client.Services().AddService(serviceRequest)

serviceRequest.Host = "bar.io"
updatedService, err := client.Services().UpdateServiceById(createdService.Id, serviceRequest)
result, err := client.Services().UpdateServicebyRouteId(routeInformation.Id)

Delete a service

err = client.Services().DeleteServiceById(createdService.Id)

SNIs

Create an SNI (for more information on the Sni Fields see the Kong documentation):

client := gokong.NewClient(gokong.NewDefaultConfig())

certificateRequest := &gokong.CertificateRequest{
  Cert: "public key --- 123",
  Key:  "private key --- 111",
}

certificate, err := client.Certificates().Create(certificateRequest)

snisRequest := &gokong.SnisRequest{
  Name:             "example.com",
  SslCertificateId: certificate.Id,
}

sni, err := client.Snis().Create(snisRequest)

Get an SNI by name:

sni, err := client.Snis().GetByName("example.com")

List all SNIs:

snis, err := client.Snis().List()

Delete an SNI by name:

err := client.Snis().DeleteByName("example.com")

Update an SNI by name:

updateSniRequest := &gokong.SnisRequest{
  Name:             "example.com",
  SslCertificateId: "a9797703-3ae6-44a9-9f0a-4ebb5d7f301f",
}

updatedSni, err := client.Snis().UpdateByName("example.com", updateSniRequest)

Upstreams

Create an Upstream (for more information on the Upstream Fields see the Kong documentation):

upstreamRequest := &gokong.UpstreamRequest{
  Name: "test-upstream",
  Slots: 10,
}

createdUpstream, err := gokong.NewClient(gokong.NewDefaultConfig()).Upstreams().Create(upstreamRequest)

Get an Upstream by id:

upstream, err := gokong.NewClient(gokong.NewDefaultConfig()).Upstreams().GetById("3705d962-caa8-4d0b-b291-4f0e85fe227a")

Get an Upstream by name:

upstream, err := gokong.NewClient(gokong.NewDefaultConfig()).Upstreams().GetByName("test-upstream")

List all Upstreams:

upstreams, err := gokong.NewClient(gokong.NewDefaultConfig()).Upstreams().List()

List all Upstreams with a filter:

upstreams, err := gokong.NewClient(gokong.NewDefaultConfig()).Upstreams().ListFiltered(&gokong.UpstreamFilter{Name:"test-upstream", Slots:10})

Delete an Upstream by id:

err := gokong.NewClient(gokong.NewDefaultConfig()).Upstreams().DeleteById("3a46b122-47ee-4c5d-b2de-49be84a672e6")

Delete an Upstream by name:

err := gokong.NewClient(gokong.NewDefaultConfig()).Upstreams().DeleteById("3a46b122-47ee-4c5d-b2de-49be84a672e6")

Delete an Upstream by id:

err := gokong.NewClient(gokong.NewDefaultConfig()).Upstreams().DeleteByName("test-upstream")

Update an Upstream by id:

updateUpstreamRequest := &gokong.UpstreamRequest{
  Name: "test-upstream",
  Slots: 10,
}

updatedUpstream, err := gokong.NewClient(gokong.NewDefaultConfig()).Upstreams().UpdateById("3a46b122-47ee-4c5d-b2de-49be84a672e6", updateUpstreamRequest)

Update an Upstream by name:

updateUpstreamRequest := &gokong.UpstreamRequest{
  Name: "test-upstream",
  Slots: 10,
}

updatedUpstream, err := gokong.NewClient(gokong.NewDefaultConfig()).Upstreams().UpdateByName("test-upstream", updateUpstreamRequest)

Contributing

I would love to get contributions to the project so please feel free to submit a PR. To setup your dev station you need go and docker installed.

Once you have cloned the repository the make command will build the code and run all of the tests. If they all pass then you are good to go!

If when you run the make command you get the following error:

gofmt needs running on the following files:

Then all you need to do is run make goimports this will reformat all of the code (I know awesome)!!

Documentation

Index

Constants

View Source
const ApisPath = "/apis/"
View Source
const CertificatesPath = "/certificates/"
View Source
const ConsumersPath = "/consumers/"
View Source
const EnvKongAdminHostAddress = "KONG_ADMIN_ADDR"
View Source
const EnvKongAdminPassword = "KONG_ADMIN_PASSWORD"
View Source
const EnvKongAdminToken = "KONG_ADMIN_TOKEN"
View Source
const EnvKongAdminUsername = "KONG_ADMIN_USERNAME"
View Source
const EnvKongApiHostAddress = "KONG_API_ADDR"
View Source
const EnvKongApiKey = "KONG_API_KEY"
View Source
const EnvKongTLSSkipVerify = "TLS_SKIP_VERIFY"
View Source
const PluginsPath = "/plugins/"
View Source
const RoutesPath = "/routes/"
View Source
const ServicesPath = "/services/"
View Source
const SnisPath = "/snis/"
View Source
const UpstreamsPath = "/upstreams/"

Variables

This section is empty.

Functions

func Bool added in v1.0.0

func Bool(v bool) *bool

func GetEnvVarOrDefault

func GetEnvVarOrDefault(key string, defaultValue string) string

func Int added in v1.0.0

func Int(v int) *int

func String added in v1.0.0

func String(v string) *string

func StringSlice added in v1.0.0

func StringSlice(src []string) []*string

func StringValueSlice added in v1.0.0

func StringValueSlice(src []*string) []string

Types

type ActiveHealthy

type ActiveHealthy struct {
	HttpStatuses []int `json:"http_statuses,omitempty"`
	Interval     int   `json:"interval,omitempty"`
	Successes    int   `json:"successes,omitempty"`
}

type ActiveUnhealthy

type ActiveUnhealthy struct {
	HttpFailures int   `json:"http_failures,omitempty"`
	HttpStatuses []int `json:"http_statuses,omitempty"`
	Interval     int   `json:"interval,omitempty"`
	TcpFailures  int   `json:"tcp_failures,omitempty"`
	Timeouts     int   `json:"timeouts,omitempty"`
}

type Api

type Api struct {
	Id                     *string   `json:"id"`
	CreatedAt              *int      `json:"created_at"`
	Name                   *string   `json:"name"`
	Hosts                  []*string `json:"hosts,omitempty"`
	Uris                   []*string `json:"uris,omitempty"`
	Methods                []*string `json:"methods,omitempty"`
	UpstreamUrl            *string   `json:"upstream_url"`
	StripUri               *bool     `json:"strip_uri,omitempty"`
	PreserveHost           *bool     `json:"preserve_host,omitempty"`
	Retries                *int      `json:"retries,omitempty"`
	UpstreamConnectTimeout *int      `json:"upstream_connect_timeout,omitempty"`
	UpstreamSendTimeout    *int      `json:"upstream_send_timeout,omitempty"`
	UpstreamReadTimeout    *int      `json:"upstream_read_timeout,omitempty"`
	HttpsOnly              *bool     `json:"https_only,omitempty"`
	HttpIfTerminated       *bool     `json:"http_if_terminated,omitempty"`
}

func (*Api) UnmarshalJSON added in v1.7.0

func (a *Api) UnmarshalJSON(data []byte) error

type ApiClient

type ApiClient struct {
	// contains filtered or unexported fields
}

func (*ApiClient) Create

func (apiClient *ApiClient) Create(newApi *ApiRequest) (*Api, error)

func (*ApiClient) DeleteById

func (apiClient *ApiClient) DeleteById(id string) error

func (*ApiClient) DeleteByName

func (apiClient *ApiClient) DeleteByName(name string) error

func (*ApiClient) GetById

func (apiClient *ApiClient) GetById(id string) (*Api, error)

func (*ApiClient) GetByName

func (apiClient *ApiClient) GetByName(name string) (*Api, error)

func (*ApiClient) List

func (apiClient *ApiClient) List() (*Apis, error)

func (*ApiClient) ListFiltered

func (apiClient *ApiClient) ListFiltered(filter *ApiFilter) (*Apis, error)

func (*ApiClient) UpdateById

func (apiClient *ApiClient) UpdateById(id string, apiRequest *ApiRequest) (*Api, error)

func (*ApiClient) UpdateByName

func (apiClient *ApiClient) UpdateByName(name string, apiRequest *ApiRequest) (*Api, error)

type ApiFilter

type ApiFilter struct {
	Id          string `url:"id,omitempty"`
	Name        string `url:"name,omitempty"`
	UpstreamUrl string `url:"upstream_url,omitempty"`
	Retries     int    `url:"retries,omitempty"`
	Size        int    `url:"size,omitempty"`
	Offset      int    `url:"offset,omitempty"`
}

type ApiRequest

type ApiRequest struct {
	Name                   *string   `json:"name"`
	Hosts                  []*string `json:"hosts"`
	Uris                   []*string `json:"uris"`
	Methods                []*string `json:"methods"`
	UpstreamUrl            *string   `json:"upstream_url"`
	StripUri               *bool     `json:"strip_uri,omitempty"`
	PreserveHost           *bool     `json:"preserve_host,omitempty"`
	Retries                *int      `json:"retries,omitempty"`
	UpstreamConnectTimeout *int      `json:"upstream_connect_timeout,omitempty"`
	UpstreamSendTimeout    *int      `json:"upstream_send_timeout,omitempty"`
	UpstreamReadTimeout    *int      `json:"upstream_read_timeout,omitempty"`
	HttpsOnly              *bool     `json:"https_only,omitempty"`
	HttpIfTerminated       *bool     `json:"http_if_terminated,omitempty"`
}

func (*ApiRequest) MarshalJSON added in v1.7.0

func (a *ApiRequest) MarshalJSON() ([]byte, error)

type Apis

type Apis struct {
	Results []*Api `json:"data,omitempty"`
	Total   int    `json:"total,omitempty"`
	Next    string `json:"next,omitempty"`
	Offset  string `json:"offset,omitempty"`
}

type Certificate

type Certificate struct {
	Id   *string `json:"id,omitempty"`
	Cert *string `json:"cert,omitempty"`
	Key  *string `json:"key,omitempty"`
}

type CertificateClient

type CertificateClient struct {
	// contains filtered or unexported fields
}

func (*CertificateClient) Create

func (certificateClient *CertificateClient) Create(certificateRequest *CertificateRequest) (*Certificate, error)

func (*CertificateClient) DeleteById

func (certificateClient *CertificateClient) DeleteById(id string) error

func (*CertificateClient) GetById

func (certificateClient *CertificateClient) GetById(id string) (*Certificate, error)

func (*CertificateClient) List

func (certificateClient *CertificateClient) List() (*Certificates, error)

func (*CertificateClient) UpdateById

func (certificateClient *CertificateClient) UpdateById(id string, certificateRequest *CertificateRequest) (*Certificate, error)

type CertificateRequest

type CertificateRequest struct {
	Cert *string `json:"cert,omitempty"`
	Key  *string `json:"key,omitempty"`
}

type Certificates

type Certificates struct {
	Results []*Certificate `json:"data,omitempty"`
	Total   int            `json:"total,omitempty"`
}

type Config

type Config struct {
	HostAddress        string
	Username           string
	Password           string
	InsecureSkipVerify bool
	ApiKey             string
	AdminToken         string
}

func NewDefaultConfig

func NewDefaultConfig() *Config

type Consumer

type Consumer struct {
	Id       string `json:"id,omitempty"`
	CustomId string `json:"custom_id,omitempty"`
	Username string `json:"username,omitempty"`
}

type ConsumerClient

type ConsumerClient struct {
	// contains filtered or unexported fields
}

func (*ConsumerClient) Create

func (consumerClient *ConsumerClient) Create(consumerRequest *ConsumerRequest) (*Consumer, error)

func (*ConsumerClient) CreatePluginConfig

func (consumerClient *ConsumerClient) CreatePluginConfig(consumerId string, pluginName string, pluginConfig string) (*ConsumerPluginConfig, error)

func (*ConsumerClient) DeleteById

func (consumerClient *ConsumerClient) DeleteById(id string) error

func (*ConsumerClient) DeleteByUsername

func (consumerClient *ConsumerClient) DeleteByUsername(username string) error

func (*ConsumerClient) DeletePluginConfig

func (consumerClient *ConsumerClient) DeletePluginConfig(consumerId string, pluginName string, id string) error

func (*ConsumerClient) GetById

func (consumerClient *ConsumerClient) GetById(id string) (*Consumer, error)

func (*ConsumerClient) GetByUsername

func (consumerClient *ConsumerClient) GetByUsername(username string) (*Consumer, error)

func (*ConsumerClient) GetPluginConfig

func (consumerClient *ConsumerClient) GetPluginConfig(consumerId string, pluginName string, id string) (*ConsumerPluginConfig, error)

func (*ConsumerClient) List

func (consumerClient *ConsumerClient) List() (*Consumers, error)

func (*ConsumerClient) ListFiltered

func (consumerClient *ConsumerClient) ListFiltered(filter *ConsumerFilter) (*Consumers, error)

func (*ConsumerClient) ListPluginConfig added in v1.9.1

func (consumerClient *ConsumerClient) ListPluginConfig(consumerId string, pluginName string) (*ConsumerPluginConfigs, error)

func (*ConsumerClient) UpdateById

func (consumerClient *ConsumerClient) UpdateById(id string, consumerRequest *ConsumerRequest) (*Consumer, error)

func (*ConsumerClient) UpdateByUsername

func (consumerClient *ConsumerClient) UpdateByUsername(username string, consumerRequest *ConsumerRequest) (*Consumer, error)

type ConsumerFilter

type ConsumerFilter struct {
	Id       string `url:"id,omitempty"`
	CustomId string `url:"custom_id,omitempty"`
	Username string `url:"username,omitempty"`
	Size     int    `url:"size,omitempty"`
	Offset   int    `url:"offset,omitempty"`
}

type ConsumerPluginConfig

type ConsumerPluginConfig struct {
	Id   string `json:"id,omitempty"`
	Body string
}

func (*ConsumerPluginConfig) UnmarshalJSON added in v1.9.1

func (c *ConsumerPluginConfig) UnmarshalJSON(data []byte) error

type ConsumerPluginConfigs added in v1.9.1

type ConsumerPluginConfigs struct {
	Results []*ConsumerPluginConfig `json:"data,omitempty"`
	Total   int                     `json:"total,omitempty"`
	Next    string                  `json:"next,omitempty"`
}

type ConsumerRequest

type ConsumerRequest struct {
	Username string `json:"username,omitempty"`
	CustomId string `json:"custom_id,omitempty"`
}

type Consumers

type Consumers struct {
	Results []*Consumer `json:"data,omitempty"`
	Total   int         `json:"total,omitempty"`
	Next    string      `json:"next,omitempty"`
}

type KongAdminClient

type KongAdminClient struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(config *Config) *KongAdminClient

func (*KongAdminClient) Apis

func (kongAdminClient *KongAdminClient) Apis() *ApiClient

func (*KongAdminClient) Certificates

func (kongAdminClient *KongAdminClient) Certificates() *CertificateClient

func (*KongAdminClient) Consumers

func (kongAdminClient *KongAdminClient) Consumers() *ConsumerClient

func (*KongAdminClient) Plugins

func (kongAdminClient *KongAdminClient) Plugins() *PluginClient

func (*KongAdminClient) Routes

func (kongAdminClient *KongAdminClient) Routes() *RouteClient

func (*KongAdminClient) Services

func (kongAdminClient *KongAdminClient) Services() *ServiceClient

func (*KongAdminClient) Snis

func (kongAdminClient *KongAdminClient) Snis() *SnisClient

func (*KongAdminClient) Status

func (kongAdminClient *KongAdminClient) Status() *StatusClient

func (*KongAdminClient) Upstreams

func (kongAdminClient *KongAdminClient) Upstreams() *UpstreamClient

type PassiveHealthy

type PassiveHealthy struct {
	HttpStatuses []int `json:"http_statuses,omitempty"`
	Successes    int   `json:"successes,omitempty"`
}

type PassiveUnhealthy

type PassiveUnhealthy struct {
	HttpFailures int   `json:"http_failures,omitempty"`
	HttpStatuses []int `json:"http_statuses,omitempty"`
	TcpFailures  int   `json:"tcp_failures,omitempty"`
	Timeouts     int   `json:"timeouts,omitempty"`
}

type Plugin

type Plugin struct {
	Id         string                 `json:"id"`
	Name       string                 `json:"name"`
	ApiId      string                 `json:"api_id,omitempty"`
	ConsumerId string                 `json:"consumer_id,omitempty"`
	ServiceId  string                 `json:"service_id,omitempty"`
	RouteId    string                 `json:"route_id,omitempty"`
	Config     map[string]interface{} `json:"config,omitempty"`
	Enabled    bool                   `json:"enabled,omitempty"`
}

type PluginClient

type PluginClient struct {
	// contains filtered or unexported fields
}

func (*PluginClient) Create

func (pluginClient *PluginClient) Create(pluginRequest *PluginRequest) (*Plugin, error)

func (*PluginClient) DeleteById

func (pluginClient *PluginClient) DeleteById(id string) error

func (*PluginClient) GetById

func (pluginClient *PluginClient) GetById(id string) (*Plugin, error)

func (*PluginClient) List

func (pluginClient *PluginClient) List() (*Plugins, error)

func (*PluginClient) ListFiltered

func (pluginClient *PluginClient) ListFiltered(filter *PluginFilter) (*Plugins, error)

func (*PluginClient) UpdateById

func (pluginClient *PluginClient) UpdateById(id string, pluginRequest *PluginRequest) (*Plugin, error)

type PluginFilter

type PluginFilter struct {
	Id         string `url:"id,omitempty"`
	Name       string `url:"name,omitempty"`
	ApiId      string `url:"api_id,omitempty"`
	ConsumerId string `url:"consumer_id,omitempty"`
	ServiceId  string `url:"service_id,omitempty"`
	RouteId    string `url:"route_id,omitempty"`
	Size       int    `url:"size,omitempty"`
	Offset     int    `url:"offset,omitempty"`
}

type PluginRequest

type PluginRequest struct {
	Name       string                 `json:"name"`
	ApiId      string                 `json:"api_id,omitempty"`
	ConsumerId string                 `json:"consumer_id,omitempty"`
	ServiceId  string                 `json:"service_id,omitempty"`
	RouteId    string                 `json:"route_id,omitempty"`
	Config     map[string]interface{} `json:"config,omitempty"`
}

type Plugins

type Plugins struct {
	Results []*Plugin `json:"data,omitempty"`
	Total   int       `json:"total,omitempty"`
	Next    string    `json:"next,omitempty"`
}

type Route

type Route struct {
	Id            *string             `json:"id"`
	CreatedAt     *int                `json:"created_at"`
	UpdatedAt     *int                `json:"updated_at"`
	Protocols     []*string           `json:"protocols"`
	Methods       []*string           `json:"methods"`
	Hosts         []*string           `json:"hosts"`
	Paths         []*string           `json:"paths"`
	RegexPriority *int                `json:"regex_priority"`
	StripPath     *bool               `json:"strip_path"`
	PreserveHost  *bool               `json:"preserve_host"`
	Service       *RouteServiceObject `json:"service"`
}

type RouteClient

type RouteClient struct {
	// contains filtered or unexported fields
}

func (*RouteClient) AddRoute

func (routeClient *RouteClient) AddRoute(routeRequest *RouteRequest) (*Route, error)

func (*RouteClient) DeleteRoute

func (routeClient *RouteClient) DeleteRoute(id string) error

func (*RouteClient) GetRoute

func (routeClient *RouteClient) GetRoute(id string) (*Route, error)

func (*RouteClient) GetRoutes

func (routeClient *RouteClient) GetRoutes(query *RouteQueryString) ([]*Route, error)

func (*RouteClient) GetRoutesFromServiceId

func (routeClient *RouteClient) GetRoutesFromServiceId(id string) ([]*Route, error)

func (*RouteClient) GetRoutesFromServiceName

func (routeClient *RouteClient) GetRoutesFromServiceName(name string) ([]*Route, error)

func (*RouteClient) UpdateRoute

func (routeClient *RouteClient) UpdateRoute(id string, routeRequest *RouteRequest) (*Route, error)

type RouteQueryString

type RouteQueryString struct {
	Offset int
	Size   int
}

type RouteRequest

type RouteRequest struct {
	Protocols    []*string           `json:"protocols"`
	Methods      []*string           `json:"methods"`
	Hosts        []*string           `json:"hosts"`
	Paths        []*string           `json:"paths"`
	StripPath    *bool               `json:"strip_path"`
	PreserveHost *bool               `json:"preserve_host"`
	Service      *RouteServiceObject `json:"service"`
}

type RouteServiceObject

type RouteServiceObject struct {
	Id string `json:"id"`
}

type Routes

type Routes struct {
	Data  []*Route `json:"data"`
	Total int      `json:"total"`
	Next  string   `json:"next"`
}

type Service

type Service struct {
	Id             *string `json:"id"`
	CreatedAt      *int    `json:"created_at"`
	UpdatedAt      *int    `json:"updated_at"`
	Protocol       *string `json:"protocol"`
	Host           *string `json:"host"`
	Port           *int    `json:"port"`
	Path           *string `json:"path"`
	Name           *string `json:"name"`
	Retries        *int    `json:"retries"`
	ConnectTimeout *int    `json:"connect_timeout"`
	WriteTimeout   *int    `json:"write_timeout"`
	ReadTimeout    *int    `json:"read_timeout"`
}

type ServiceClient

type ServiceClient struct {
	// contains filtered or unexported fields
}

func (*ServiceClient) AddService

func (serviceClient *ServiceClient) AddService(serviceRequest *ServiceRequest) (*Service, error)

func (*ServiceClient) DeleteServiceById

func (serviceClient *ServiceClient) DeleteServiceById(id string) error

func (*ServiceClient) DeleteServiceByName

func (serviceClient *ServiceClient) DeleteServiceByName(name string) error

func (*ServiceClient) GetServiceById

func (serviceClient *ServiceClient) GetServiceById(id string) (*Service, error)

func (*ServiceClient) GetServiceByName

func (serviceClient *ServiceClient) GetServiceByName(name string) (*Service, error)

func (*ServiceClient) GetServiceFromRouteId

func (serviceClient *ServiceClient) GetServiceFromRouteId(id string) (*Service, error)

func (*ServiceClient) GetServices

func (serviceClient *ServiceClient) GetServices(query *ServiceQueryString) ([]*Service, error)

func (*ServiceClient) UpdateServiceById

func (serviceClient *ServiceClient) UpdateServiceById(id string, serviceRequest *ServiceRequest) (*Service, error)

func (*ServiceClient) UpdateServiceByName

func (serviceClient *ServiceClient) UpdateServiceByName(name string, serviceRequest *ServiceRequest) (*Service, error)

func (*ServiceClient) UpdateServicebyRouteId

func (serviceClient *ServiceClient) UpdateServicebyRouteId(id string, serviceRequest *ServiceRequest) (*Service, error)

type ServiceQueryString

type ServiceQueryString struct {
	Offset int
	Size   int
}

type ServiceRequest

type ServiceRequest struct {
	Name           *string `json:"name"`
	Protocol       *string `json:"protocol"`
	Host           *string `json:"host"`
	Port           *int    `json:"port,omitempty"`
	Path           *string `json:"path,omitempty"`
	Retries        *int    `json:"retries,omitempty"`
	ConnectTimeout *int    `json:"connect_timeout,omitempty"`
	WriteTimeout   *int    `json:"write_timeout,omitempty"`
	ReadTimeout    *int    `json:"read_timeout,omitempty"`
}

type Services

type Services struct {
	Data []*Service `json:"data"`
	Next *string    `json:"next"`
}

type Sni

type Sni struct {
	Name             string `json:"name,omitempty"`
	SslCertificateId string `json:"ssl_certificate_id,omitempty"`
}

type Snis

type Snis struct {
	Results []*Sni `json:"data,omitempty"`
	Total   int    `json:"total,omitempty"`
}

type SnisClient

type SnisClient struct {
	// contains filtered or unexported fields
}

func (*SnisClient) Create

func (snisClient *SnisClient) Create(snisRequest *SnisRequest) (*Sni, error)

func (*SnisClient) DeleteByName

func (snisClient *SnisClient) DeleteByName(name string) error

func (*SnisClient) GetByName

func (snisClient *SnisClient) GetByName(name string) (*Sni, error)

func (*SnisClient) List

func (snisClient *SnisClient) List() (*Snis, error)

func (*SnisClient) UpdateByName

func (snisClient *SnisClient) UpdateByName(name string, snisRequest *SnisRequest) (*Sni, error)

type SnisRequest

type SnisRequest struct {
	Name             string `json:"name,omitempty"`
	SslCertificateId string `json:"ssl_certificate_id,omitempty"`
}

type Status

type Status struct {
	Server   serverStatus   `json:"server"`
	Database databaseStatus `json:"database"`
}

type StatusClient

type StatusClient struct {
	// contains filtered or unexported fields
}

func (*StatusClient) Get

func (statusClient *StatusClient) Get() (*Status, error)

type Upstream

type Upstream struct {
	Id string `json:"id,omitempty"`
	UpstreamRequest
}

type UpstreamClient

type UpstreamClient struct {
	// contains filtered or unexported fields
}

func (*UpstreamClient) Create

func (upstreamClient *UpstreamClient) Create(upstreamRequest *UpstreamRequest) (*Upstream, error)

func (*UpstreamClient) DeleteById

func (upstreamClient *UpstreamClient) DeleteById(id string) error

func (*UpstreamClient) DeleteByName

func (upstreamClient *UpstreamClient) DeleteByName(name string) error

func (*UpstreamClient) GetById

func (upstreamClient *UpstreamClient) GetById(id string) (*Upstream, error)

func (*UpstreamClient) GetByName

func (upstreamClient *UpstreamClient) GetByName(name string) (*Upstream, error)

func (*UpstreamClient) List

func (upstreamClient *UpstreamClient) List() (*Upstreams, error)

func (*UpstreamClient) ListFiltered

func (upstreamClient *UpstreamClient) ListFiltered(filter *UpstreamFilter) (*Upstreams, error)

func (*UpstreamClient) UpdateById

func (upstreamClient *UpstreamClient) UpdateById(id string, upstreamRequest *UpstreamRequest) (*Upstream, error)

func (*UpstreamClient) UpdateByName

func (upstreamClient *UpstreamClient) UpdateByName(name string, upstreamRequest *UpstreamRequest) (*Upstream, error)

type UpstreamFilter

type UpstreamFilter struct {
	Id     string `url:"id,omitempty"`
	Name   string `url:"name,omitempty"`
	Slots  int    `url:"slots,omitempty"`
	Size   int    `url:"size,omitempty"`
	Offset int    `url:"offset,omitempty"`
}

type UpstreamHealthCheck

type UpstreamHealthCheck struct {
	Active  *UpstreamHealthCheckActive  `json:"active,omitempty"`
	Passive *UpstreamHealthCheckPassive `json:"passive,omitempty"`
}

type UpstreamHealthCheckActive

type UpstreamHealthCheckActive struct {
	Concurrency int              `json:"concurrency,omitempty"`
	Healthy     *ActiveHealthy   `json:"healthy,omitempty"`
	HttpPath    string           `json:"http_path,omitempty"`
	Timeout     int              `json:"timeout,omitempty"`
	Unhealthy   *ActiveUnhealthy `json:"unhealthy,omitempty"`
}

type UpstreamHealthCheckPassive

type UpstreamHealthCheckPassive struct {
	Healthy   *PassiveHealthy   `json:"healthy,omitempty"`
	Unhealthy *PassiveUnhealthy `json:"unhealthy,omitempty"`
}

type UpstreamRequest

type UpstreamRequest struct {
	Name               string               `json:"name"`
	Slots              int                  `json:"slots,omitempty"`
	HashOn             string               `json:"hash_on,omitempty"`
	HashFallback       string               `json:"hash_fallback,omitempty"`
	HashOnHeader       string               `json:"hash_on_header,omitempty"`
	HashFallbackHeader string               `json:"hash_fallback_header,omitempty"`
	HealthChecks       *UpstreamHealthCheck `json:"healthchecks,omitempty"`
}

type Upstreams

type Upstreams struct {
	Results []*Upstream `json:"data,omitempty"`
	Total   int         `json:"total,omitempty"`
	Next    string      `json:"next,omitempty"`
	Offset  string      `json:"offset,omitempty"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL