gw

package
v1.11.2 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: GPL-3.0 Imports: 24 Imported by: 0

Documentation

Overview

Package gw is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	// EnsureUploaded will process every given item for sync and ensure that the content
	// is present in the target exodus-gw environment.
	//
	// For each item, onUploaded is invoked if the item was uploaded during the call;
	// onPresent is invoked if the item was already present prior to the call;
	// onDuplicate is invoked if a duplicate item is detected within the publish.
	//
	// Returning from the callback with an error will cause EnsureUploaded to stop and
	// return the same error.
	EnsureUploaded(ctx context.Context, items []walk.SyncItem,
		onUploaded func(walk.SyncItem) error,
		onPresent func(walk.SyncItem) error,
		onDuplicate func(walk.SyncItem) error,
	) error

	// NewPublish creates and returns a new publish object within exodus-gw.
	NewPublish(context.Context) (Publish, error)

	// GetPublish returns a handle to an existing publish object within exodus-gw.
	GetPublish(ctx context.Context, id string) (Publish, error)

	// WhoAmI returns raw authentication & authorization info for this exodus-gw client
	// in the format provided by the "/whoami" endpoint.
	//
	// This function is intended for debugging purposes only.
	WhoAmI(context.Context) (map[string]interface{}, error)
}

Client provides a high-level interface to the exodus-gw HTTP API.

type Interface

type Interface interface {
	// NewClient creates and returns a new exodus-gw client with the given
	// configuration.
	NewClient(context.Context, conf.Config) (Client, error)

	// NewDryRunClient creates and returns a new exodus-gw client in dry-run
	// mode. This client replaces any write operations with stubs.
	NewDryRunClient(context.Context, conf.Config) (Client, error)
}

Interface defines the public interface of this package.

var Package Interface = impl{}

Package provides the default implementation of this package's interface.

type ItemInput

type ItemInput struct {
	WebURI      string `json:"web_uri"`
	ObjectKey   string `json:"object_key"`
	ContentType string `json:"content_type"`
	LinkTo      string `json:"link_to"`
}

ItemInput is a single item accepted for publish by the AddItems method.

type MockClient

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

MockClient is a mock of Client interface.

func NewMockClient

func NewMockClient(ctrl *gomock.Controller) *MockClient

NewMockClient creates a new mock instance.

func (*MockClient) EXPECT

func (m *MockClient) EXPECT() *MockClientMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockClient) EnsureUploaded

func (m *MockClient) EnsureUploaded(ctx context.Context, items []walk.SyncItem, onUploaded, onPresent, onDuplicate func(walk.SyncItem) error) error

EnsureUploaded mocks base method.

func (*MockClient) GetPublish added in v0.2.0

func (m *MockClient) GetPublish(ctx context.Context, id string) (Publish, error)

GetPublish mocks base method.

func (*MockClient) NewPublish

func (m *MockClient) NewPublish(arg0 context.Context) (Publish, error)

NewPublish mocks base method.

func (*MockClient) WhoAmI added in v1.5.0

func (m *MockClient) WhoAmI(arg0 context.Context) (map[string]interface{}, error)

WhoAmI mocks base method.

type MockClientMockRecorder

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

MockClientMockRecorder is the mock recorder for MockClient.

func (*MockClientMockRecorder) EnsureUploaded

func (mr *MockClientMockRecorder) EnsureUploaded(ctx, items, onUploaded, onPresent, onDuplicate interface{}) *gomock.Call

EnsureUploaded indicates an expected call of EnsureUploaded.

func (*MockClientMockRecorder) GetPublish added in v0.2.0

func (mr *MockClientMockRecorder) GetPublish(ctx, id interface{}) *gomock.Call

GetPublish indicates an expected call of GetPublish.

func (*MockClientMockRecorder) NewPublish

func (mr *MockClientMockRecorder) NewPublish(arg0 interface{}) *gomock.Call

NewPublish indicates an expected call of NewPublish.

func (*MockClientMockRecorder) WhoAmI added in v1.5.0

func (mr *MockClientMockRecorder) WhoAmI(arg0 interface{}) *gomock.Call

WhoAmI indicates an expected call of WhoAmI.

type MockInterface

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

MockInterface is a mock of Interface interface.

func NewMockInterface

func NewMockInterface(ctrl *gomock.Controller) *MockInterface

NewMockInterface creates a new mock instance.

func (*MockInterface) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockInterface) NewClient

func (m *MockInterface) NewClient(arg0 context.Context, arg1 conf.Config) (Client, error)

NewClient mocks base method.

func (*MockInterface) NewDryRunClient added in v0.2.0

func (m *MockInterface) NewDryRunClient(arg0 context.Context, arg1 conf.Config) (Client, error)

NewDryRunClient mocks base method.

type MockInterfaceMockRecorder

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

MockInterfaceMockRecorder is the mock recorder for MockInterface.

func (*MockInterfaceMockRecorder) NewClient

func (mr *MockInterfaceMockRecorder) NewClient(arg0, arg1 interface{}) *gomock.Call

NewClient indicates an expected call of NewClient.

func (*MockInterfaceMockRecorder) NewDryRunClient added in v0.2.0

func (mr *MockInterfaceMockRecorder) NewDryRunClient(arg0, arg1 interface{}) *gomock.Call

NewDryRunClient indicates an expected call of NewDryRunClient.

type MockPublish

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

MockPublish is a mock of Publish interface.

func NewMockPublish

func NewMockPublish(ctrl *gomock.Controller) *MockPublish

NewMockPublish creates a new mock instance.

func (*MockPublish) AddItems

func (m *MockPublish) AddItems(arg0 context.Context, arg1 []ItemInput) error

AddItems mocks base method.

func (*MockPublish) Commit

func (m *MockPublish) Commit(ctx context.Context, mode string) error

Commit mocks base method.

func (*MockPublish) EXPECT

func (m *MockPublish) EXPECT() *MockPublishMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockPublish) ID

func (m *MockPublish) ID() string

ID mocks base method.

type MockPublishMockRecorder

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

MockPublishMockRecorder is the mock recorder for MockPublish.

func (*MockPublishMockRecorder) AddItems

func (mr *MockPublishMockRecorder) AddItems(arg0, arg1 interface{}) *gomock.Call

AddItems indicates an expected call of AddItems.

func (*MockPublishMockRecorder) Commit

func (mr *MockPublishMockRecorder) Commit(ctx, mode interface{}) *gomock.Call

Commit indicates an expected call of Commit.

func (*MockPublishMockRecorder) ID

ID indicates an expected call of ID.

type MockTask

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

MockTask is a mock of Task interface.

func NewMockTask

func NewMockTask(ctrl *gomock.Controller) *MockTask

NewMockTask creates a new mock instance.

func (*MockTask) Await

func (m *MockTask) Await(arg0 context.Context) error

Await mocks base method.

func (*MockTask) EXPECT

func (m *MockTask) EXPECT() *MockTaskMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockTask) ID

func (m *MockTask) ID() string

ID mocks base method.

type MockTaskMockRecorder

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

MockTaskMockRecorder is the mock recorder for MockTask.

func (*MockTaskMockRecorder) Await

func (mr *MockTaskMockRecorder) Await(arg0 interface{}) *gomock.Call

Await indicates an expected call of Await.

func (*MockTaskMockRecorder) ID

func (mr *MockTaskMockRecorder) ID() *gomock.Call

ID indicates an expected call of ID.

type Publish

type Publish interface {
	// ID is the unique identifier of a publish.
	ID() string

	// AddItems will add all of the specified items onto this publish.
	// This may involve multiple requests to exodus-gw.
	AddItems(context.Context, []ItemInput) error

	// Commit will cause this publish object to become committed, making all of
	// the included content available from the CDN.
	//
	// The commit operation within exodus-gw is asynchronous. This method will
	// wait for the commit to complete fully and will return nil only if the
	// commit has succeeded.
	//
	// 'mode' is the desired commit mode (see exodus-gw docs). It can be empty
	// to not request any particular mode.
	Commit(ctx context.Context, mode string) error
}

Publish represents a publish object in exodus-gw.

type Task

type Task interface {
	// ID is the unique ID of this task.
	ID() string

	// Await will repeatedly refresh the state of this task from exodus-gw
	// and return once the task has reached a terminal state.
	//
	// The return value will be nil if and only if the task succeeded.
	Await(context.Context) error
}

Task represents a single task object within exodus-gw.

Jump to

Keyboard shortcuts

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