argocd

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2026 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const BaseAPIPath = "/api/v1"

BaseAPIPath is the base path for all ArgoCD API endpoints.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client is the root ArgoCD client.

func New

func New(opts Options) *Client

New constructs a new ArgoCD client.

ArgoCD does NOT modify transports or tokens. httpclient is assumed to be fully configured by the caller.

func (*Client) Do

func (c *Client) Do(ctx context.Context, req *http.Request) (*http.Response, error)

Do delegates all HTTP behavior to the underlying httpclient.Client.

func (*Client) Host

func (c *Client) Host() Host

Host returns the configured ArgoCD host.

func (*Client) HttpClient

func (c *Client) HttpClient() *httpclient.Client

HttpClient returns the underlying HTTP client.

type Host

type Host string

Host represents the base URL of an ArgoCD server.

func (Host) ToString

func (h Host) ToString() string

type MockRequester

type MockRequester struct {
	mock.Mock
}

MockRequester is an autogenerated mock type for the Requester type

func NewMockRequester

func NewMockRequester(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockRequester

NewMockRequester creates a new instance of MockRequester. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockRequester) Do

func (_m *MockRequester) Do(ctx context.Context, req *http.Request) (*http.Response, error)

Do provides a mock function with given fields: ctx, req

func (*MockRequester) EXPECT

func (_m *MockRequester) EXPECT() *MockRequester_Expecter

func (*MockRequester) Host

func (_m *MockRequester) Host() Host

Host provides a mock function with no fields

func (*MockRequester) HttpClient

func (_m *MockRequester) HttpClient() *httpclient.Client

HttpClient provides a mock function with no fields

type MockRequester_Do_Call

type MockRequester_Do_Call struct {
	*mock.Call
}

MockRequester_Do_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Do'

func (*MockRequester_Do_Call) Return

func (*MockRequester_Do_Call) Run

func (*MockRequester_Do_Call) RunAndReturn

type MockRequester_Expecter

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

func (*MockRequester_Expecter) Do

func (_e *MockRequester_Expecter) Do(ctx interface{}, req interface{}) *MockRequester_Do_Call

Do is a helper method to define mock.On call

  • ctx context.Context
  • req *http.Request

func (*MockRequester_Expecter) Host

Host is a helper method to define mock.On call

func (*MockRequester_Expecter) HttpClient

HttpClient is a helper method to define mock.On call

type MockRequester_Host_Call

type MockRequester_Host_Call struct {
	*mock.Call
}

MockRequester_Host_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Host'

func (*MockRequester_Host_Call) Return

func (*MockRequester_Host_Call) Run

func (_c *MockRequester_Host_Call) Run(run func()) *MockRequester_Host_Call

func (*MockRequester_Host_Call) RunAndReturn

func (_c *MockRequester_Host_Call) RunAndReturn(run func() Host) *MockRequester_Host_Call

type MockRequester_HttpClient_Call

type MockRequester_HttpClient_Call struct {
	*mock.Call
}

MockRequester_HttpClient_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HttpClient'

func (*MockRequester_HttpClient_Call) Return

func (*MockRequester_HttpClient_Call) Run

func (*MockRequester_HttpClient_Call) RunAndReturn

type Options

type Options struct {
	Host       Host
	HttpClient *httpclient.Client
}

Options defines how to construct an ArgoCD client.

Note:

  • HttpClient must already be configured (auth, transport, logger).
  • ArgoCD pkg does not touch transport or tokens.

type Requester

type Requester interface {
	Host() Host
	HttpClient() *httpclient.Client
	Do(ctx context.Context, req *http.Request) (*http.Response, error)
}

Requester defines the minimal HTTP capability required by all ArgoCD services. It abstracts the underlying httpclient without leaking third-party types.

This interface exists strictly for testing and keeps services decoupled from the concrete Client implementation, following the project coding conventions.

type Token

type Token string

Token represents the authentication token provided by the caller.

func (Token) ToString

func (t Token) ToString() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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