bootstrap

package
v0.0.0-...-9742f5a Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2020 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Application

type Application interface {
	common.StarterShutdowner
}

func NewApplication

func NewApplication(l *logrus.Logger, b *Bootstrapd, db *sql.DB, conf *ConfigFile) (Application, error)

type BootstrapInfo

type BootstrapInfo struct {
	PublicKey   ed25519.PublicKey
	Stats       *CacheStats
	StartupTime time.Time
	Port        uint32
	ContactUrl  string
}

type Bootstrapd

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

func NewBootstrapd

func NewBootstrapd(l *logrus.Logger) *Bootstrapd

func (*Bootstrapd) HandleCacheAnnounceRequest

func (b *Bootstrapd) HandleCacheAnnounceRequest(ctx context.Context, req *ccmsg.CacheAnnounceRequest) (*ccmsg.CacheAnnounceResponse, error)

func (*Bootstrapd) HandleCacheFetchRequest

func (b *Bootstrapd) HandleCacheFetchRequest(ctx context.Context, req *ccmsg.CacheFetchRequest) (*ccmsg.CacheFetchResponse, error)

type CacheStats

type CacheStats struct {
	FreeMemory  uint64
	TotalMemory uint64

	FreeDisk  uint64
	TotalDisk uint64
}

func NewCacheStats

func NewCacheStats() *CacheStats

func (*CacheStats) ReadDiskStats

func (cs *CacheStats) ReadDiskStats(path string) error

func (*CacheStats) ReadMemoryStats

func (cs *CacheStats) ReadMemoryStats()

type Client

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

func NewClient

func NewClient(l *logrus.Logger, addr string, insecure bool) (*Client, error)

func (*Client) AnnounceCache

func (c *Client) AnnounceCache(ctx context.Context, info BootstrapInfo) error

func (*Client) FetchCaches

func (c *Client) FetchCaches(ctx context.Context) ([]*ccmsg.CacheDescription, error)

type ConfigFile

type ConfigFile struct {
	GrpcAddr      string `json:"grpc_addr"`
	Database      string `json:"database"`
	StatusAddr    string `json:"status_addr"`
	ProxyProtocol bool   `json:"proxy_protocol"`
	Insecure      bool   `json:"insecure"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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