backend

package
v0.4.159 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileHandler

type FileHandler interface {
	io.Closer
	io.Reader
	io.ReaderAt
	io.Seeker
	io.Writer
	io.WriterAt
	Stat() (os.FileInfo, error)
	WriteString(s string) (int, error)
}

FileHandler abstracts file interfaces shared between "os" and "afero" so that both can be used interchangeably

type FileSystem

type FileSystem interface {
	Create(name string) (FileHandler, error)
	MkdirAll(path string, perm os.FileMode) error
	OpenFile(name string, flag int, perm os.FileMode) (FileHandler, error)
	ReadFile(filename string) ([]byte, error)
	RemoveAll(path string) error
	Walk(root string, walkFn filepath.WalkFunc) error
}

FileSystem abstracts Afero/os calls

type Journal

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

func SetRealJournal

func SetRealJournal(j *sdjournal.Journal) *Journal

func (*Journal) AddMatch

func (j *Journal) AddMatch(match string) error

func (*Journal) Close

func (j *Journal) Close() error

func (*Journal) GetEntry

func (j *Journal) GetEntry() (*sdjournal.JournalEntry, error)

func (*Journal) Next

func (j *Journal) Next() (uint64, error)

type Logger

type Logger interface {
	AddMatch(match string) error
	Close() error
	GetEntry() (*sdjournal.JournalEntry, error)
	Next() (uint64, error)
}

Logger abstracts systemd journal entries

type Network

type Network struct{}

func (*Network) GetConnections

func (n *Network) GetConnections(kind string) ([]gonet.ConnectionStat, error)

type NetworkManager

type NetworkManager interface {
	GetConnections(kind string) ([]gonet.ConnectionStat, error)
}

NetworkManager abstracts connection on ports

type OS

type OS struct{}

func (*OS) Create

func (o *OS) Create(name string) (FileHandler, error)

func (*OS) FileInfoHeader

func (o *OS) FileInfoHeader(fi os.FileInfo, link string) (*tar.Header, error)

func (*OS) IsRegular

func (o *OS) IsRegular(fi os.FileInfo) bool

func (*OS) MkdirAll

func (o *OS) MkdirAll(path string, perm os.FileMode) error

func (*OS) OpenFile

func (o *OS) OpenFile(name string, flag int, perm os.FileMode) (FileHandler, error)

func (*OS) ReadFile

func (o *OS) ReadFile(filename string) ([]byte, error)

func (*OS) RemoveAll

func (o *OS) RemoveAll(path string) error

func (*OS) Walk

func (o *OS) Walk(root string, walkFn filepath.WalkFunc) error

type P2P

type P2P struct{}

func (*P2P) ClearIncomingChatRequests

func (p *P2P) ClearIncomingChatRequests() error

func (*P2P) Decode

func (p *P2P) Decode(id string) (peer.ID, error)

type PeerManager

type PeerManager interface {
	ClearIncomingChatRequests() error
	Decode(s string) (peer.ID, error)
}

PeerManager abstracts libp2p functionality

type ResourceManager

type ResourceManager interface {
	GetTotalProvisioned() *models.Provisioned
}

type Resources

type Resources struct{}

func (*Resources) GetTotalProvisioned

func (r *Resources) GetTotalProvisioned() *models.Provisioned

type Utility

type Utility interface {
	IsOnboarded() (bool, error)
	ReadMetadataFile() (*models.MetadataV2, error)
	ResponseBody(c *gin.Context, method, endpoint, query string, body []byte) ([]byte, error)
}

Utility abstracts helper functions under utils package

type Utils

type Utils struct{}

func (*Utils) IsOnboarded

func (u *Utils) IsOnboarded() (bool, error)

func (*Utils) ReadMetadataFile

func (u *Utils) ReadMetadataFile() (*models.MetadataV2, error)

func (*Utils) ResponseBody

func (u *Utils) ResponseBody(c *gin.Context, method, endpoint, query string, body []byte) ([]byte, error)

type Wallet

type Wallet struct{}

func (*Wallet) GetCardanoAddressAndMnemonic

func (w *Wallet) GetCardanoAddressAndMnemonic() (*models.BlockchainAddressPrivKey, error)

func (*Wallet) GetEthereumAddressAndPrivateKey

func (w *Wallet) GetEthereumAddressAndPrivateKey() (*models.BlockchainAddressPrivKey, error)

type WalletManager

type WalletManager interface {
	GetCardanoAddressAndMnemonic() (*models.BlockchainAddressPrivKey, error)
	GetEthereumAddressAndPrivateKey() (*models.BlockchainAddressPrivKey, error)
}

type WebSocket

type WebSocket struct {
	Conn *websocket.Conn
}

func (*WebSocket) Close

func (ws *WebSocket) Close() error

func (*WebSocket) Initialize

func (ws *WebSocket) Initialize(url string) error

func (*WebSocket) Ping

func (ws *WebSocket) Ping(ctx context.Context, w io.Writer) error

func (*WebSocket) ReadMessage

func (ws *WebSocket) ReadMessage(ctx context.Context, w io.Writer) error

func (*WebSocket) WriteMessage

func (ws *WebSocket) WriteMessage(ctx context.Context, r io.Reader) error

type WebSocketClient

type WebSocketClient interface {
	Initialize(url string) error
	Close() error
	ReadMessage(ctx context.Context, w io.Writer) error
	WriteMessage(ctx context.Context, r io.Reader) error
	Ping(ctx context.Context, w io.Writer) error
}

WebSocketClient provides functionality to chat commands

Jump to

Keyboard shortcuts

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