gitea_token_client

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: Apache-2.0 Imports: 10 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GiteaTokenClient

type GiteaTokenClient struct {
	GiteaTokenClientFunc GiteaTokenClientFunc `json:"-"`
	// contains filtered or unexported fields
}

func (*GiteaTokenClient) GetBaseUrl

func (g *GiteaTokenClient) GetBaseUrl() string

GetBaseUrl returns the base URL of the Gitea instance

func (*GiteaTokenClient) GetUsername

func (g *GiteaTokenClient) GetUsername() string

GetUsername returns the username by SetBasicAuth

func (*GiteaTokenClient) GiteaClient

func (g *GiteaTokenClient) GiteaClient() *gitea.Client

GiteaClient returns the gitea.Client

func (*GiteaTokenClient) IsDebug

func (g *GiteaTokenClient) IsDebug() bool

IsDebug returns the debug status

func (*GiteaTokenClient) NewClient

func (g *GiteaTokenClient) NewClient(url, accessToken string, httpClient *http.Client) error

NewClient creates a new Gitea client This function is a wrapper around gitea.NewClient

func (*GiteaTokenClient) NewClientWithHttpTimeout

func (g *GiteaTokenClient) NewClientWithHttpTimeout(url, accessToken string, timeoutSecond uint, insecure bool) error

NewClientWithHttpTimeout creates a new Gitea client with a timeout for the http client The timeout is in seconds, and the minimum is 30 seconds If insecure is true, the client will skip SSL verification This function is a wrapper around gitea.NewClient

func (*GiteaTokenClient) SetBasicAuth

func (g *GiteaTokenClient) SetBasicAuth(username, password string)

SetBasicAuth sets the basic auth for the client from gitea.Client

func (*GiteaTokenClient) SetDebug

func (g *GiteaTokenClient) SetDebug(debug bool)

SetDebug sets the debug status for the client from gitea.Client

func (*GiteaTokenClient) SetOTP

func (g *GiteaTokenClient) SetOTP(otp string)

SetOTP sets the otp for the client from gitea.Client

func (*GiteaTokenClient) SetSudo

func (g *GiteaTokenClient) SetSudo(sudo string)

SetSudo sets the sudo for the client from gitea.Client

type GiteaTokenClientFunc

type GiteaTokenClientFunc interface {
	NewClientWithHttpTimeout(url, accessToken string, timeoutSecond uint, insecure bool) error

	NewClient(url, accessToken string, httpClient *http.Client) error

	SetDebug(debug bool)

	IsDebug() bool

	SetOTP(otp string)

	SetSudo(sudo string)

	SetBasicAuth(username, password string)

	GiteaClient() *gitea.Client

	GetBaseUrl() string

	GetUsername() string
}

Jump to

Keyboard shortcuts

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