fx

package
v1.2.150 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2025 License: Unlicense Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Flows added in v1.2.140

type Flows interface {
	AuthHeader(token string) map[string]string
	Authorization() string
	Authentication() string
	Enrollment() string
	Recovery() string
	Settings() string
	Sessions() string
	Logout() string
}

func NewAuthentikFlows added in v1.2.140

func NewAuthentikFlows(baseURL, token string) Flows

type Fx added in v1.1.52

type Fx struct {
	Rpc *rpc.Client
	Eth *ethclient.Client

	Http *http.Client
	*zero.Zero
	// contains filtered or unexported fields
}

func Init added in v1.2.140

func Init() *Fx

func (*Fx) AddPath added in v1.2.139

func (f *Fx) AddPath(dir string, prefix string)

Walk directory and load files into memory, determine Content-Type based on file extension. Register route/<prefix/<file without extension>.

func (*Fx) ConnectPostgres added in v1.1.52

func (f *Fx) ConnectPostgres(dbName string) (*sql.DB, error)

func (*Fx) ConnectRedis added in v1.1.52

func (f *Fx) ConnectRedis(dbNumber int, password string) (*redis.Client, error)

func (*Fx) GethHandler added in v1.2.135

func (f *Fx) GethHandler(w http.ResponseWriter, r *http.Request)

GethHandler handles JSON-RPC requests via IPC

func (*Fx) In added in v1.2.139

func (f *Fx) In(endpoint string, options ...GetOption) ([]byte, error)

Get executes Http GET requests with the given URL and options

func (*Fx) NewOAuthClient added in v1.1.52

func (f *Fx) NewOAuthClient(clientID, clientSecret, tokenURL string, scopes []string) (*http.Client, error)

NewOAuthClient returns an authenticated HTTP client using OAuth2 client credentials flow with automatic token refreshing and all requested scopes.

func (*Fx) Node added in v1.1.52

func (f *Fx) Node() error

Establish geth.ipc connection

func (*Fx) Out added in v1.2.139

func (f *Fx) Out(w http.ResponseWriter, input func() (any, error), locker sync.Locker)

Out writes single response for http requests, using a function to source data and a locker to synchronize access or an HTTP 500 error when the input function fails or JSON encoding fails.

func (*Fx) Print added in v1.2.139

func (f *Fx) Print(value any)

Print value as indented JSON to the standard output or logs error when value cannot be marshaled.

func (*Fx) Simplify added in v1.2.139

func (f *Fx) Simplify(input any) any

Simplify processes any input, flattens it, and removes empty fields.

type GetOption added in v1.2.139

type GetOption func(*http.Request)

GetOption represents a function that modifies a GET request

func WithAPIKey added in v1.2.139

func WithAPIKey(apiKey string) GetOption

func WithBasicAuth added in v1.2.139

func WithBasicAuth(username, password string) GetOption

func WithBearerToken added in v1.2.139

func WithBearerToken(token string) GetOption

func WithHeader added in v1.2.139

func WithHeader(key, value string) GetOption

Header option builders

func WithQuery added in v1.2.139

func WithQuery(key string, values ...string) GetOption

Query parameter option builders

func WithQueryMap added in v1.2.139

func WithQueryMap(params map[string]string) GetOption

Jump to

Keyboard shortcuts

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