MCPcopy Create free account
hub / github.com/cloudspannerecosystem/spanner-cli / createSession

Function createSession

cli.go:322–337  ·  view source on GitHub ↗
(projectId string, instanceId string, databaseId string, credential []byte,
	priority pb.RequestOptions_Priority, role string, endpoint string, directedRead *pb.DirectedReadOptions,
	skipTLSVerify bool, protoDescriptor []byte)

Source from the content-addressed store, hash-verified

320}
321
322func createSession(projectId string, instanceId string, databaseId string, credential []byte,
323 priority pb.RequestOptions_Priority, role string, endpoint string, directedRead *pb.DirectedReadOptions,
324 skipTLSVerify bool, protoDescriptor []byte) (*Session, error) {
325 var opts []option.ClientOption
326 if credential != nil {
327 opts = append(opts, option.WithCredentialsJSON(credential))
328 }
329 if endpoint != "" {
330 opts = append(opts, option.WithEndpoint(endpoint))
331 }
332 if skipTLSVerify {
333 creds := credentials.NewTLS(&tls.Config{InsecureSkipVerify: true})
334 opts = append(opts, option.WithGRPCDialOption(grpc.WithTransportCredentials(creds)))
335 }
336 return NewSession(projectId, instanceId, databaseId, priority, role, directedRead, protoDescriptor, opts...)
337}
338
339func readInteractiveInput(rl *readline.Instance, prompt string) (*inputStatement, error) {
340 defer rl.SetPrompt(prompt)

Callers 2

NewCliFunction · 0.85
RunInteractiveMethod · 0.85

Calls 1

NewSessionFunction · 0.85

Tested by

no test coverage detected