logs

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const ItemCountPerPage = 50

max number of items returned by Auth0 for each API call (see https://auth0.com/docs/troubleshoot/product-lifecycle/past-migrations/migrate-to-paginated-queries)

Variables

View Source
var ErrAPIRateLimitReached = errors.New("client reached api rate limit")

Functions

func New

func New(domain, clientID, clientSecret, token string) (*logClient, error)

New returns a new instance of the log fetching client, plus possible errors

Types

type Client

type Client interface {
	List(ctx context.Context, args ...interface{}) (interface{}, error)
}

type ClientMock

type ClientMock struct {
	// ListFunc mocks the List method.
	ListFunc func(ctx context.Context, args ...interface{}) (interface{}, error)
	// contains filtered or unexported fields
}

ClientMock is a mock implementation of Client.

func TestSomethingThatUsesClient(t *testing.T) {

	// make and configure a mocked Client
	mockedClient := &ClientMock{
		ListFunc: func(ctx context.Context, args ...interface{}) (interface{}, error) {
			panic("mock out the List method")
		},
	}

	// use mockedClient in code that requires Client
	// and then make assertions.

}

func (*ClientMock) List

func (mock *ClientMock) List(ctx context.Context, args ...interface{}) (interface{}, error)

List calls ListFunc.

func (*ClientMock) ListCalls

func (mock *ClientMock) ListCalls() []struct {
	Ctx  context.Context
	Args []interface{}
}

ListCalls gets all the calls that were made to List. Check the length with:

len(mockedClient.ListCalls())

Jump to

Keyboard shortcuts

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