block

package
v0.0.0-...-3b473a0 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

README

Example showcasing Go documentation with godoc. Read more in "Efficient Go"; Example 2-9.

Usage

Prerequisite: go installed.

  1. Pull the repo on local machine.
  2. Go to the directory where this README exists.
  3. Run make. This will trigger godoc installation on your local machine. Then it will start godoc in serving mode that serves documentation on port 6060.
  4. Once you see "using module mode; ...", go to localhost:6060 in your browser. You see all available modules on your machine, including standard library. For pkg/godoc package see http://localhost:6060/pkg/github.com/efficientgo/examples/pkg/godoc/.

Documentation

Overview

Package block contains common functionality for interacting with TSDB blocks in the context of Thanos.

Index

Examples

Constants

View Source
const (
	// MetaFilename is the known JSON filename for meta information.
	MetaFilename = "meta.json"
)

Variables

This section is empty.

Functions

func Download

func Download(ctx context.Context, id ulid.ULID, dst string) error

Download downloads directory that is meant to be block directory. If any of the files have a hash calculated in the meta file and it matches with what is in the destination path then we do not download it. We always re-download the meta file. BUG(bwplotka): No known bugs, but if there was one, it would be outlined here.

Example
package main

import (
	"context"
	"fmt"

	block "github.com/efficientgo/examples/pkg/godoc"
	"github.com/oklog/ulid"
)

func main() {
	if err := block.Download(context.Background(), ulid.MustNew(0, nil), "here"); err != nil {
		fmt.Println(err)
	}
}
Output:

downloaded

Types

This section is empty.

Notes

Bugs

  • No known bugs, but if there was one, it would be outlined here.

Jump to

Keyboard shortcuts

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