utils

package
v0.0.0-...-763d59e Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2022 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Overview

* Test用サーバーを構築するためのコード * bufconnによって他のコンテナを立てず接続Testができる

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertJsonStrToFloatMatrix

func ConvertJsonStrToFloatMatrix(data string) ([][]float64, error)

func ConvertJsonStrToInterface

func ConvertJsonStrToInterface(data string) (interface{}, error)

func ConvertJsonStrToMap

func ConvertJsonStrToMap(data string) (map[string]interface{}, error)

func ConvertPredictRequest

func ConvertPredictRequest(in *pb_l2m.PredictRequest) *pb_m2c.PredictRequest

func ConvertToJsonstr

func ConvertToJsonstr(data interface{}) (string, error)

func CreateJobuuid

func CreateJobuuid() (string, error)

func CreateRandInt32Slice

func CreateRandInt32Slice(sliceSize uint32) ([]int32, error)

func EscapeInjection

func EscapeInjection(in string, nptype NiqlParamType) string

func NewLockSet

func NewLockSet() *lockSet

Types

type Containers

type Containers struct {
	Manage      *url.URL
	Computation *url.URL
	Dbg         *url.URL
	PartyList   []Party
}

type IpAddressCollection

type IpAddressCollection struct {
	PartyID       int
	NParties      int
	Containers    Containers
	AllowedOrigin []*url.URL
}

func GetConfig

func GetConfig() (IpAddressCollection, error)

TODO: errにメッセージをつけてstacktraceを返すようにする "github.com/pkg/errors"のerrors.WithMessageを使用推奨

type NiqlParamType

type NiqlParamType int
const (
	Select NiqlParamType = iota // Select  == 0
	Where                       // Where   == 1
)

Enum

type Party

type Party struct {
	PartyID   int
	IpAddress *url.URL
}

type TestServer

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

func (*TestServer) GetConn

func (s *TestServer) GetConn() *grpc.ClientConn

func (*TestServer) GetServer

func (s *TestServer) GetServer() *grpc.Server

func (*TestServer) Serve

func (s *TestServer) Serve()

Jump to

Keyboard shortcuts

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