dist

package
v0.0.0-...-487b4a4 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2024 License: GPL-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TmplStatsText  *template.Template
	TmplStatsFuncs = map[string]interface{}{
		"sprintf":        fmt.Sprintf,
		"sumcpu":         func(c *pb.StatsCPUTime) int64 { return c.UserSeconds + c.SystemSeconds },
		"div6432":        func(b int32, a int64) int64 { return a / int64(b) },
		"div6464":        func(b, a int64) int64 { return a / b },
		"seconds2string": func(s int64) string { return FmtSecondDuration(s) },
		"cputime2string": func(c *pb.StatsCPUTime) string {
			return FmtSecondDuration(c.UserSeconds + c.SystemSeconds)
		},
	}
)

Functions

func Arch

func Arch(m *pb.RenderingMetadata) string

func FmtSecondDuration

func FmtSecondDuration(e int64) string

func FormatDuration

func FormatDuration(t time.Duration) string

func LegacyOrderToOrder

func LegacyOrderToOrder(in *Order) *pb.Order

func ParseLegacyJSON

func ParseLegacyJSON(buf []byte) (*pb.RenderingMetadata, error)

func S3Parse

func S3Parse(s string) (string, string, string, error)

S3Parse return bucket, dir, fn.

Types

type DBWrap

type DBWrap interface {
	BeginTx(context.Context, *sql.TxOptions) (TXWrap, error)
	Close() error
	Driver() driver.Driver
	ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error)
	PingContext(ctx context.Context) error
	// Prepare(query string) (*sql.Stmt, error)
	QueryContext(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error)
	QueryRowContext(ctx context.Context, query string, args ...interface{}) *sql.Row
	SetConnMaxLifetime(d time.Duration)
	SetMaxIdleConns(n int)
	SetMaxOpenConns(n int)
	Stats() sql.DBStats
}

func NewDBWrap

func NewDBWrap(db *sql.DB, logger *log.Logger) DBWrap

type Order

type Order struct {
	Package     string   // Path to tarfile on S3.
	Dir         string   // Dir to chdir to before rendering.
	File        string   // File in package to render.
	Destination string   // S3 directory to place results in.
	Args        []string // Povray args.
}

TODO: Deprecated. Use protobuf version instead. This is still used in the database and between dscheduler and drender, in json encoding.

type PerRPC

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

PerRPC is a magic callback that the gRPC framework calls on every RPC. Here it's used to turn `context.Context` "values" into gRPC "Metadata". On the other end of the RPC they can later be fetched using `grpcmetadata.FromContext(ctx)`

func NewPerRPC

func NewPerRPC(forward []string) *PerRPC

func (*PerRPC) GetRequestMetadata

func (p *PerRPC) GetRequestMetadata(ctx context.Context, uri ...string) (map[string]string, error)

func (*PerRPC) RequireTransportSecurity

func (*PerRPC) RequireTransportSecurity() bool

type TXWrap

type TXWrap interface {
	Commit() error
	ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error)
	//Prepare(query string) (*sql.Stmt, error)
	QueryContext(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error)
	QueryRowContext(ctx context.Context, query string, args ...interface{}) *sql.Row
	Rollback() error
}

Directories

Path Synopsis
proto
Package rpclog is a generated protocol buffer package.
Package rpclog is a generated protocol buffer package.

Jump to

Keyboard shortcuts

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