types

package
v0.3.8 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2024 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthorizerKey

type AuthorizerKey struct {
	// ID is a key UUID.
	ID string `db:"id"`
	// Source identify which authorizer and\or
	// federation cluster added the key.
	// Must be the same as key owner in the federation keystore.
	// The rule above must be enforced by the API implementation.
	Source string `db:"source"`
	// Key is a byte64-encoded representation of rsa.PublicKey
	Key string `db:"key"`
}

func (*AuthorizerKey) Unwrap

func (key *AuthorizerKey) Unwrap() (xcrypto.KeyInfo, error)

func (*AuthorizerKey) Validate

func (key *AuthorizerKey) Validate() error

type EventlogSubscriber added in v0.3.5

type EventlogSubscriber struct {
	SubscriberID string      `db:"subscriber_id"`
	LogID        string      `db:"log_id"`
	Offset       int64       `db:"offset"`
	Updated      *xtime.Time `db:"updated"`
}

type PeerIdentifiers

type PeerIdentifiers struct {
	UserId         *string    `db:"user_id"`
	InstallationId *uuid.UUID `db:"installation_id"`
	SessionId      *uuid.UUID `db:"session_id"`
}

type PeerInfo

type PeerInfo struct {
	WireguardInfo
	PeerIdentifiers

	ID      int64       `db:"id"`
	Label   *string     `db:"label"`
	Ipv4    *xnet.IP    `db:"ipv4" json:"-"`
	Created *xtime.Time `db:"created"`
	Updated *xtime.Time `db:"updated"`
	Expires *xtime.Time `db:"expires"`
	Claims  *string     `db:"claims"`

	SharingKey           *string `db:"sharing_key"`
	SharingKeyExpiration *int64  `db:"sharing_key_expiration"`

	NetworkAccessPolicy *int `db:"net_access_policy"`
	RateLimit           *int `db:"net_rate_limit"`

	Upstream   *int64      `db:"upstream"`
	Downstream *int64      `db:"downstream"`
	Activity   *xtime.Time `db:"activity"`
}

func (*PeerInfo) Expired

func (peer *PeerInfo) Expired() bool

func (*PeerInfo) GetNetworkPolicy added in v0.2.4

func (peer *PeerInfo) GetNetworkPolicy() ipam.Policy

func (*PeerInfo) IntoProto

func (peer *PeerInfo) IntoProto() *proto.PeerInfo

func (*PeerInfo) Validate

func (peer *PeerInfo) Validate(omit ...string) error

type WGPrivateKey

type WGPrivateKey wgtypes.Key

let the compiler check types for us

func (WGPrivateKey) Public

func (p WGPrivateKey) Public() WGPublicKey

func (WGPrivateKey) Unwrap

func (p WGPrivateKey) Unwrap() wgtypes.Key

type WGPublicKey

type WGPublicKey wgtypes.Key

let the compiler check types for us

func (WGPublicKey) Unwrap

func (p WGPublicKey) Unwrap() wgtypes.Key

type WireguardInfo

type WireguardInfo struct {
	WireguardPublicKey *string `db:"wireguard_key"`
}

Jump to

Keyboard shortcuts

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