sources

package
v0.0.0-...-16063ba Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound = errors.New("metadata not found")
)

errors

Functions

This section is empty.

Types

type Data

type Data struct {
	Contract string
	Metadata []byte
}

Data -

type FactoryParams

type FactoryParams struct {
	Sourcify *SourcifyConfig
	FS       *FileSystemConfig
}

FactoryParams -

type FileSystem

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

FileSystem -

func NewFileSystem

func NewFileSystem(rootDir string) *FileSystem

NewFileSystem -

func (*FileSystem) Get

func (fs *FileSystem) Get(ctx context.Context, contract string) ([]byte, error)

Get -

func (*FileSystem) List

func (fs *FileSystem) List(ctx context.Context) ([]string, error)

List -

type FileSystemConfig

type FileSystemConfig struct {
	Dir string `yaml:"dir" validate:"required,dir"`
}

FileSystemConfig -

type Source

type Source interface {
	Get(ctx context.Context, contract string) ([]byte, error)
	List(ctx context.Context) ([]string, error)
}

Source -

func Factory

func Factory(typ Type, params FactoryParams) (Source, error)

Factory -

type Sourcify

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

Sourcify -

func NewSourcify

func NewSourcify(cfg *SourcifyConfig) *Sourcify

NewSourcify -

func (*Sourcify) Get

func (s *Sourcify) Get(ctx context.Context, contract string) ([]byte, error)

Get -

func (*Sourcify) List

func (s *Sourcify) List(ctx context.Context) ([]string, error)

List -

type SourcifyConfig

type SourcifyConfig struct {
	BaseURL string `yaml:"base_url" validate:"required,url"`
	Timeout int    `yaml:"timeout" validate:"required,min=0"`
	ChainID uint64 `yaml:"chain_id" validate:"required,min=1"`
}

SourcifyConfig -

type Type

type Type string

Type -

const (
	FSType       Type = "fs"
	SourcifyType Type = "sourcify"
)

types

Jump to

Keyboard shortcuts

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