emulator

package
v0.0.0-...-5597880 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ColumnNullable

func ColumnNullable(name string) *types.Column

func ColumnRepeated

func ColumnRepeated(name string) *types.Column

func ColumnRequired

func ColumnRequired(name string) *types.Column

Types

type Dataset

type Dataset struct {
	DatasetID string
	TableID   string
	Columns   []*types.Column
}

type Emulator

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

func New

func New(log zerolog.Logger) *Emulator

func (*Emulator) Cleanup

func (e *Emulator) Cleanup()

func (*Emulator) EnableMock

func (e *Emulator) EnableMock(debugRequest bool, log zerolog.Logger, mocks ...*EndpointMock)

func (*Emulator) Endpoint

func (e *Emulator) Endpoint() string

func (*Emulator) Serve

func (e *Emulator) Serve(ctx context.Context, httpAddr, grpcAddr string) error

func (*Emulator) TestServer

func (e *Emulator) TestServer()

func (*Emulator) WithProject

func (e *Emulator) WithProject(projectID string, datasets ...*Dataset)

func (*Emulator) WithSource

func (e *Emulator) WithSource(projectID string, source server.Source)

type EndpointMock

type EndpointMock struct {
	Path    string
	Method  string
	Handler http.HandlerFunc
}

func DatasetTableIAMPolicyGetMock

func DatasetTableIAMPolicyGetMock(project, dataset, table string, log zerolog.Logger, policy *iampb.Policy) *EndpointMock

func DatasetTableIAMPolicySetMock

func DatasetTableIAMPolicySetMock(project, dataset, table string, log zerolog.Logger, into *iampb.SetIamPolicyRequest) *EndpointMock

type PolicyMock

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

func NewPolicyMock

func NewPolicyMock(log zerolog.Logger) *PolicyMock

func (*PolicyMock) GetPolicy

func (p *PolicyMock) GetPolicy() http.HandlerFunc

func (*PolicyMock) Mocks

func (p *PolicyMock) Mocks() []*EndpointMock

func (*PolicyMock) SetPolicy

func (p *PolicyMock) SetPolicy() http.HandlerFunc

Jump to

Keyboard shortcuts

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