util

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: Apache-2.0, MIT Imports: 38 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PermRead  auth.Permission = "read" // default
	PermWrite auth.Permission = "write"
	PermSign  auth.Permission = "sign"  // Use wallet keys for signing
	PermAdmin auth.Permission = "admin" // Manage permissions
)

Variables

View Source
var (
	Endpoint, _        = tag.NewKey("endpoint")
	APIRequestDuration = stats.Float64("api/request_duration_ms", "Duration of API requests", stats.UnitMilliseconds)
)
View Source
var (
	AllPermissions = []auth.Permission{PermRead, PermWrite, PermSign, PermAdmin}
	DefaultPerms   = []auth.Permission{PermRead}
)

Functions

func ImportChain

func ImportChain(ctx context.Context, r repo.Repo, fname string, snapshot bool, backfillTipsetkeyRange int) (err error)

func ImportFromFsFile added in v0.8.6

func ImportFromFsFile(ctx context.Context, r repo.Repo, fs fs.File, snapshot bool) (err error)

used for test vectors only

func MetricsSentinelAPI

func MetricsSentinelAPI(a lily.LilyAPI) lily.LilyAPI

func PermissionedSentinelAPI

func PermissionedSentinelAPI(a lily.LilyAPI) lily.LilyAPI

func ServeRPC

func ServeRPC(a lily.LilyAPI, stop node.StopFunc, addr multiaddr.Multiaddr, shutdownCh <-chan struct{}, maxRequestSize int64) error

func SinceInMilliseconds

func SinceInMilliseconds(startTime time.Time) float64

SinceInMilliseconds returns the duration of time since the provide time as a float64.

func Timer

func Timer(ctx context.Context, m *stats.Float64Measure) func()

Timer is a function stopwatch, calling it starts the timer, calling the returned function will record the duration.

Types

This section is empty.

Jump to

Keyboard shortcuts

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