opslevel_example

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Wrapping the client can be useful when you want to override default behavior, such as always setting context or disallowing (to the best of Go's ability) access to specific receiver functions on `opslevel.Client`. Here is an example of wrapping the client to always require context to be passed while also maintaining the ability to pass in default options, with the ability to extend your own set of options if need-be:

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	*opslevel.Client
	// contains filtered or unexported fields
}

func NewClient

func NewClient(ctx context.Context, apiToken string, options ...Option) *Client

type Option

type Option func(*Client)

Option is our own functional option type for our own custom client.

func WithCustomOption

func WithCustomOption(custom string) Option

func WithPageSize

func WithPageSize(pageSize int) Option

func WithURL

func WithURL(url string) Option

Jump to

Keyboard shortcuts

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