reports

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2025 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ServerList = []string{
	"https://global.api.konghq.com",
	"https://us.api.konghq.com",
	"https://eu.api.konghq.com",
	"https://au.api.konghq.com",
}

ServerList contains the list of servers available to the SDK

Functions

func ApplyReports

func ApplyReports(
	ctx context.Context,
	reportsService CustomReportsService,
) error

If you change the name of a report, a new one will be created and the old one remains

func Bool

func Bool(b bool) *bool

Bool provides a helper function to return a pointer to a bool

func Float32

func Float32(f float32) *float32

Float32 provides a helper function to return a pointer to a float32

func Float64

func Float64(f float64) *float64

Float64 provides a helper function to return a pointer to a float64

func Int

func Int(i int) *int

Int provides a helper function to return a pointer to an int

func Int64

func Int64(i int64) *int64

Int64 provides a helper function to return a pointer to an int64

func Pointer

func Pointer[T any](v T) *T

Pointer provides a helper function to return a pointer to a type

func String

func String(s string) *string

String provides a helper function to return a pointer to a string

Types

type CustomReports

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

func (*CustomReports) CreateReport

CreateReport - New Custom Report Creates a new custom report.

func (*CustomReports) GetReport

GetReport - Fetch Custom Report Returns a single report.

func (*CustomReports) GetReports

func (s *CustomReports) GetReports(ctx context.Context,
	pageSize *int64,
	pageNumber *int64,
	opts ...operationsReports.Option,
) (*operationsReports.GetReportsResponse, error)

GetReports - List Custom Reports Returns a list of custom reports.

func (*CustomReports) UpdateReport

UpdateReport - Update Report Updates a custom report.

type CustomReportsService

type CustomReportsService interface {
	GetReports(ctx context.Context,
		pageSize *int64,
		pageNumber *int64,
		opts ...operations.Option) (*operations.GetReportsResponse, error)
	CreateReport(ctx context.Context,
		request *components.ReportInput,
		opts ...operations.Option) (*operations.CreateReportResponse, error)
}

type HTTPClient

type HTTPClient interface {
	Do(req *http.Request) (*http.Response, error)
}

HTTPClient provides an interface for suplying the SDK with a custom HTTP client

type SDK

type SDK struct {
	CustomReports *CustomReports
	// contains filtered or unexported fields
}

func New

func New(opts ...SDKOption) *SDK

New creates a new instance of the SDK with the provided options

type SDKOption

type SDKOption func(*SDK)

func WithClient

func WithClient(client HTTPClient) SDKOption

WithClient allows the overriding of the default HTTP client used by the SDK

func WithRetryConfig

func WithRetryConfig(retryConfig retry.Config) SDKOption

func WithSecurity

func WithSecurity(security components.Security) SDKOption

WithSecurity configures the SDK to use the provided security details

func WithSecuritySource

func WithSecuritySource(security func(context.Context) (components.Security, error)) SDKOption

WithSecuritySource configures the SDK to invoke the Security Source function on each method call to determine authentication

func WithServerIndex

func WithServerIndex(serverIndex int) SDKOption

WithServerIndex allows the overriding of the default server by index

func WithServerURL

func WithServerURL(serverURL string) SDKOption

WithServerURL allows the overriding of the default server URL

func WithTemplatedServerURL

func WithTemplatedServerURL(serverURL string, params map[string]string) SDKOption

WithTemplatedServerURL allows the overriding of the default server URL with a templated URL populated with the provided parameters

func WithTimeout

func WithTimeout(timeout time.Duration) SDKOption

WithTimeout Optional request timeout applied to each operation

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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