Documentation ¶
Index ¶
- Variables
- func Arch(m *pb.RenderingMetadata) string
- func FmtSecondDuration(e int64) string
- func FormatDuration(t time.Duration) string
- func LegacyOrderToOrder(in *Order) *pb.Order
- func ParseLegacyJSON(buf []byte) (*pb.RenderingMetadata, error)
- func S3Parse(s string) (string, string, string, error)
- type DBWrap
- type Order
- type PerRPC
- type TXWrap
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 FormatDuration ¶
func LegacyOrderToOrder ¶
func ParseLegacyJSON ¶
func ParseLegacyJSON(buf []byte) (*pb.RenderingMetadata, error)
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 }
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 (*PerRPC) GetRequestMetadata ¶
func (*PerRPC) RequireTransportSecurity ¶
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 }
Click to show internal directories.
Click to hide internal directories.