mirror of
https://github.com/aljazceru/lspd.git
synced 2025-12-18 14:24:21 +01:00
26 lines
481 B
Go
26 lines
481 B
Go
package lnd
|
|
|
|
import (
|
|
"context"
|
|
)
|
|
|
|
type MacaroonCredential struct {
|
|
MacaroonHex string
|
|
}
|
|
|
|
func NewMacaroonCredential(hex string) *MacaroonCredential {
|
|
return &MacaroonCredential{
|
|
MacaroonHex: hex,
|
|
}
|
|
}
|
|
|
|
func (m *MacaroonCredential) RequireTransportSecurity() bool {
|
|
return true
|
|
}
|
|
|
|
func (m *MacaroonCredential) GetRequestMetadata(ctx context.Context, uri ...string) (map[string]string, error) {
|
|
md := make(map[string]string)
|
|
md["macaroon"] = m.MacaroonHex
|
|
return md, nil
|
|
}
|