server

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2023 License: MIT Imports: 60 Imported by: 0

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

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

type AVROSchema

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

type ErrorFormat

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

type ErrorReason

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

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

type LogLevel

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

type ResponseError

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) SetLogFormat

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

func (*Server) SetLogLevel

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

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

func (e *ServerError) Error() string

func (*ServerError) ErrorProto

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

func (*ServerError) Response

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

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

type TestServer

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

func (*TestServer) GRPCClientOptions

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

func (*TestServer) GRPCDial

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

type UploadJob

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

func (*UploadJob) ToJob

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

type UploadJobConfiguration

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

type UploadJobConfigurationLoad

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