client

package
v0.0.0-...-20ea1d9 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2023 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DroneServerVariable = "DRONE_SERVER"
	DroneTokenVariable  = "DRONE_TOKEN"
)

Variables

This section is empty.

Functions

func CreateClient

func CreateClient(credential Credential) drone.Client

Creates a Drone client with the provided credential.

This function takes a Credential struct as input, containing the Drone host and token. It creates an OAuth2 client configuration and authorizes it using the provided access token. Then, it constructs a Drone client using the specified host and the authorized OAuth2 client.

Parameters:

  • credential: A Credential struct containing the Drone host and access token.

Returns:

  • drone.Client: A configured Drone client for making API requests to the specified Drone instance.

Types

type Credential

type Credential struct {
	Server string
	Token  string
}

Jump to

Keyboard shortcuts

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