brokerutil

package
v0.0.0-...-17db7c8 Latest Latest
Warning

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

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

Documentation

Overview

Due to circular references, please avoid moving this file to testutil.

Due to circular references, please avoid moving this file to testutil.

Due to circular references, please avoid moving this file to testutil.

Due to circular references, please avoid moving this file to testutil.

Index

Constants

View Source
const (
	AlicePemFilKey   = "alice_pem_file"
	BobPemFileKey    = "bob_pem_file"
	CarolPemFileKey  = "carol_pem_file"
	PartyInfoFileKey = "party_info_file"
)

Variables

This section is empty.

Functions

func CreateTestPemFiles

func CreateTestPemFiles(portsMap map[string]int, tempDir string) (filesMap map[string]string, err error)

func UpdateJobConfig

func UpdateJobConfig(jobConfig *pb.JobConfig, projectConfig *pb.ProjectConfig) *pb.JobConfig

Types

type Command

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

Simplify the complexity of calling HTTP interfaces when writing debugging tools or test code.

func NewCommand

func NewCommand(host string, timeoutS int) *Command

func (*Command) CancelJob

func (c *Command) CancelJob(jobID string) error

func (*Command) CheckAndUpdateStatus

func (c *Command) CheckAndUpdateStatus(ids []string) (*pb.CheckAndUpdateStatusResponse, error)

func (*Command) CreateJob

func (c *Command) CreateJob(projectID, query string, debugOpts *pb.DebugOptions, jobConfStr string) (string, error)

func (*Command) CreateProject

func (c *Command) CreateProject(projectID, projectConf string) (string, error)

func (*Command) CreateTable

func (c *Command) CreateTable(projectID, tableName, dbType, refTable string, columns []*pb.CreateTableRequest_ColumnDesc) error

func (*Command) CreateView

func (c *Command) CreateView(projectId, viewName, body string) error

func (*Command) DeleteTable

func (c *Command) DeleteTable(projectID, name string) error

func (*Command) DeleteView

func (c *Command) DeleteView(projectID, viewName string) error

func (*Command) DoQuery

func (c *Command) DoQuery(projectID, query string, debugOpts *pb.DebugOptions, jobConfStr string) (*pb.QueryResponse, error)

func (*Command) GetCCL

func (c *Command) GetCCL(projectID string, tables, destParties []string) (*pb.ShowCCLResponse, error)

func (*Command) GetExplain

func (c *Command) GetExplain(projectID, query, jobConfStr string) (result *pb.ExplainInfo, err error)

func (*Command) GetInvitation

func (c *Command) GetInvitation() (*pb.ListInvitationsResponse, error)

func (*Command) GetProject

func (c *Command) GetProject(projectID string) (*pb.ListProjectsResponse, error)

func (*Command) GetResult

func (c *Command) GetResult(jobID string) (result *pb.FetchResultResponse, err error)

func (*Command) GetTable

func (c *Command) GetTable(projectID string, tableNames []string) (*pb.ListTablesResponse, error)

func (*Command) GetView

func (c *Command) GetView(projectID string, viewNames []string) (*pb.ListViewsResponse, error)

func (*Command) GrantCCL

func (c *Command) GrantCCL(projectID string, ccls []*pb.ColumnControl) error

func (*Command) InviteMember

func (c *Command) InviteMember(projectID, member string) error

func (*Command) ProcessInvitation

func (c *Command) ProcessInvitation(ids string, accept bool) error

func (*Command) RevokeCCL

func (c *Command) RevokeCCL(projectID, party string, ccls []*pb.ColumnControl) error

type ResponseCheck

type ResponseCheck interface {
	GetStatusCode() int32
	FormatResponse() string
}

type ResponseWrapper

type ResponseWrapper[T StatusGetter] struct {
	Response T
}

func NewResponseWrapper

func NewResponseWrapper[T StatusGetter](response T) *ResponseWrapper[T]

func (*ResponseWrapper[T]) FormatResponse

func (resp *ResponseWrapper[T]) FormatResponse() string

func (*ResponseWrapper[T]) GetStatusCode

func (resp *ResponseWrapper[T]) GetStatusCode() int32

type StatusGetter

type StatusGetter interface {
	GetStatus() *pb.Status
}

type TestAppBuilder

type TestAppBuilder struct {
	PartyInfoTmpPath string
	PemFilePaths     map[string]string
	ServerAlice      *httptest.Server
	ServerBob        *httptest.Server
	ServerCarol      *httptest.Server
	ServerEngine     *httptest.Server
	ServerAliceUrl   string
	ServerBobUrl     string
	ServerCarolUrl   string
	ServerEngineUrl  string
	AppAlice         *application.App
	AppBob           *application.App
	AppCarol         *application.App
}

func (*TestAppBuilder) BuildAppTests

func (b *TestAppBuilder) BuildAppTests(tempDir string) error

Jump to

Keyboard shortcuts

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