Help us shape the future of Go! Take the 2026 Go Developer Survey

server

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2026 License: MIT Imports: 60 Imported by: 4

Documentation

Overview

Code generated by internal/cmd/generator. DO NOT EDIT!

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ARROWSchema added in v0.1.23

type ARROWSchema struct {
	ReadSessionSchema *storagepb.ReadSession_ArrowSchema
	Schema            *arrow.Schema
	Text              string
}

type AVROSchema added in v0.1.23

type AVROSchema struct {
	ReadSessionSchema *storagepb.ReadSession_AvroSchema
	Schema            *types.AVROSchema
	Text              string
}

type ErrorFormat added in v0.1.15

type ErrorFormat struct {
	Errors  []*ServerError `json:"errors"`
	Code    int            `json:"code"`
	Message string         `json:"message"`
}

type ErrorReason added in v0.1.15

type ErrorReason string
const (
	AccessDenied             ErrorReason = "accessDenied"
	BackendError             ErrorReason = "backendError"
	BillingNotEnabled        ErrorReason = "billingNotEnabled"
	BillingTierLimitExceeded ErrorReason = "billingTierLimitExceeded"
	Blocked                  ErrorReason = "blocked"
	Duplicate                ErrorReason = "duplicate"
	InternalError            ErrorReason = "internalError"
	Invalid                  ErrorReason = "invalid"
	InvalidQuery             ErrorReason = "invalidQuery"
	InvalidUser              ErrorReason = "invalidUser"
	JobBackendError          ErrorReason = "jobBackendError"
	JobInternalError         ErrorReason = "jobInternalError"
	NotFound                 ErrorReason = "notFound"
	NotImplemented           ErrorReason = "notImplemented"
	QuotaExceeded            ErrorReason = "quotaExceeded"
	RateLimitExceeded        ErrorReason = "rateLimitExceeded"
	ResourceInUse            ErrorReason = "resourceInUse"
	ResourcesExceeded        ErrorReason = "resourcesExceeded"
	ResponseTooLarge         ErrorReason = "responseTooLarge"
	Stopped                  ErrorReason = "stopped"
	TableUnavailable         ErrorReason = "tableUnavailable"
	Timeout                  ErrorReason = "timeout"
)

type Handler

type Handler struct {
	Path       string
	HTTPMethod string
	Handler    http.Handler
}

type LogFormat added in v0.1.3

type LogFormat string
const (
	LogFormatConsole LogFormat = "console"
	LogFormatJSON    LogFormat = "json"
)

type LogLevel added in v0.1.3

type LogLevel string
const (
	LogLevelUnknown LogLevel = "unknown"
	LogLevelDebug   LogLevel = "debug"
	LogLevelInfo    LogLevel = "info"
	LogLevelWarn    LogLevel = "warn"
	LogLevelError   LogLevel = "error"
	LogLevelFatal   LogLevel = "fatal"
)

type ResponseError added in v0.1.15

type ResponseError struct {
	Error *ErrorFormat `json:"error"`
}

type Server

type Server struct {
	Handler http.Handler
	// contains filtered or unexported fields
}

func New

func New(storage Storage) (*Server, error)

func (*Server) Close

func (s *Server) Close() error

func (*Server) Load

func (s *Server) Load(sources ...Source) error

func (*Server) Serve

func (s *Server) Serve(ctx context.Context, httpAddr, grpcAddr string) error

func (*Server) SetListenCallback added in v0.7.1

func (s *Server) SetListenCallback(callback func(httpAddr, grpcAddr string))

SetListenCallback registers a function invoked once the HTTP and gRPC listeners are bound, with the addresses they are actually listening on (useful when a port of 0 was requested). It exists so the CLI can report the bound addresses; the library itself writes nothing to stdout.

func (*Server) SetLogFormat added in v0.1.3

func (s *Server) SetLogFormat(format LogFormat) error

func (*Server) SetLogLevel added in v0.1.3

func (s *Server) SetLogLevel(level LogLevel) error

func (*Server) SetProject

func (s *Server) SetProject(id string) error

func (*Server) Stop

func (s *Server) Stop(ctx context.Context) error

func (*Server) TestServer

func (s *Server) TestServer() *TestServer

type ServerError added in v0.1.15

type ServerError struct {
	Status    int         `json:"-"`
	Reason    ErrorReason `json:"reason"`
	Location  string      `json:"location"`
	DebugInfo string      `json:"debugInfo"`
	Message   string      `json:"message"`
}

ServerError represents BigQuery errors. documentation is here. https://cloud.google.com/bigquery/docs/error-messages

func (*ServerError) Error added in v0.1.15

func (e *ServerError) Error() string

func (*ServerError) ErrorProto added in v0.1.15

func (e *ServerError) ErrorProto() *bigqueryv2.ErrorProto

func (*ServerError) Response added in v0.1.15

func (e *ServerError) Response() []byte

type Source

type Source func(*Server) error

func StructSource

func StructSource(projects ...*types.Project) Source

func YAMLSource

func YAMLSource(path string) Source

type Storage

type Storage string
const (
	MemoryStorage Storage = "file::memory:?cache=shared"
	TempStorage   Storage = "tmp"
)

type TableType added in v0.1.21

type TableType string
const (
	DefaultTableType          TableType = "TABLE"
	ViewTableType             TableType = "VIEW"
	ExternalTableType         TableType = "EXTERNAL"
	MaterializedViewTableType TableType = "MATERIALIZED_VIEW"
	SnapshotTableType         TableType = "SNAPSHOT"
)

type TestServer added in v0.1.23

type TestServer struct {
	*httptest.Server
	DialerOption grpc.DialOption
}

func (*TestServer) GRPCClientOptions added in v0.1.23

func (s *TestServer) GRPCClientOptions(ctx context.Context) ([]option.ClientOption, error)

func (*TestServer) GRPCDial added in v0.1.23

func (s *TestServer) GRPCDial(ctx context.Context) (*grpc.ClientConn, error)

type UploadJob added in v0.1.2

type UploadJob struct {
	JobReference  *bigqueryv2.JobReference `json:"jobReference"`
	Configuration *UploadJobConfiguration  `json:"configuration"`
}

func (*UploadJob) ToJob added in v0.1.2

func (j *UploadJob) ToJob() *bigqueryv2.Job

type UploadJobConfiguration added in v0.1.2

type UploadJobConfiguration struct {
	Load *UploadJobConfigurationLoad `json:"load"`
}

type UploadJobConfigurationLoad added in v0.1.2

type UploadJobConfigurationLoad struct {
	AllowJaggedRows                    bool                                   `json:"allowJaggedRows,omitempty"`
	AllowQuotedNewlines                bool                                   `json:"allowQuotedNewlines,omitempty"`
	Autodetect                         bool                                   `json:"autodetect,omitempty"`
	Clustering                         *bigqueryv2.Clustering                 `json:"clustering,omitempty"`
	CreateDisposition                  string                                 `json:"createDisposition,omitempty"`
	DecimalTargetTypes                 []string                               `json:"decimalTargetTypes,omitempty"`
	DestinationEncryptionConfiguration *bigqueryv2.EncryptionConfiguration    `json:"destinationEncryptionConfiguration,omitempty"`
	DestinationTable                   *bigqueryv2.TableReference             `json:"destinationTable,omitempty"`
	DestinationTableProperties         *bigqueryv2.DestinationTableProperties `json:"destinationTableProperties,omitempty"`
	Encoding                           string                                 `json:"encoding,omitempty"`
	FieldDelimiter                     string                                 `json:"fieldDelimiter,omitempty"`
	HivePartitioningOptions            *bigqueryv2.HivePartitioningOptions    `json:"hivePartitioningOptions,omitempty"`
	IgnoreUnknownValues                bool                                   `json:"ignoreUnknownValues,omitempty"`
	JsonExtension                      string                                 `json:"jsonExtension,omitempty"`
	MaxBadRecords                      int64                                  `json:"maxBadRecords,omitempty"`
	NullMarker                         string                                 `json:"nullMarker,omitempty"`
	ParquetOptions                     *bigqueryv2.ParquetOptions             `json:"parquetOptions,omitempty"`
	PreserveAsciiControlCharacters     bool                                   `json:"preserveAsciiControlCharacters,omitempty"`
	ProjectionFields                   []string                               `json:"projectionFields,omitempty"`
	Quote                              *string                                `json:"quote,omitempty"`
	RangePartitioning                  *bigqueryv2.RangePartitioning          `json:"rangePartitioning,omitempty"`
	Schema                             *bigqueryv2.TableSchema                `json:"schema,omitempty"`
	SchemaInline                       string                                 `json:"schemaInline,omitempty"`
	SchemaInlineFormat                 string                                 `json:"schemaInlineFormat,omitempty"`
	SchemaUpdateOptions                []string                               `json:"schemaUpdateOptions,omitempty"`
	SkipLeadingRows                    json.Number                            `json:"skipLeadingRows,omitempty"`
	SourceFormat                       string                                 `json:"sourceFormat,omitempty"`
	SourceUris                         []string                               `json:"sourceUris,omitempty"`
	TimePartitioning                   *bigqueryv2.TimePartitioning           `json:"timePartitioning,omitempty"`
	UseAvroLogicalTypes                bool                                   `json:"useAvroLogicalTypes,omitempty"`
	WriteDisposition                   string                                 `json:"writeDisposition,omitempty"`
}

Jump to

Keyboard shortcuts

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