models

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DynamoItemsToVPNInstancesMap

func DynamoItemsToVPNInstancesMap(items []map[string]types.AttributeValue) (map[string]VPNInstance, error)

func FilterInstanceByStatus

func FilterInstanceByStatus(status string) *aws.DynamoDBFilter

Types

type ModelMapper

type ModelMapper interface {
	ToModel() interface{}
}

type VPNInstance

type VPNInstance struct {
	Id         string `dynamodbav:"Id"`
	Hostname   string `dynamodbav:"Hostname"`
	Port       string `dynamodbav:"Port"`
	Status     string `dynamodbav:"Status"`
	InstanceId string `dynamodbav:"InstanceId"`
	ChatId     string `dynamodbav:"ChatId"`
}

func DynamoItemToVPNInstance

func DynamoItemToVPNInstance(item map[string]types.AttributeValue) (*VPNInstance, error)

func DynamoItemsToVPNInstances

func DynamoItemsToVPNInstances(items []map[string]types.AttributeValue) ([]VPNInstance, error)

func NewVPNInstance

func NewVPNInstance(id, hostname, port, status, instanceId, chatId string) *VPNInstance

func (*VPNInstance) ChatIdValue

func (i *VPNInstance) ChatIdValue() telegram.ChatId

func (VPNInstance) PrimaryKey

func (i VPNInstance) PrimaryKey() map[string]types.AttributeValue

func (VPNInstance) RangeKey

func (i VPNInstance) RangeKey() map[string]types.AttributeValue

func (VPNInstance) String

func (i VPNInstance) String() string

func (VPNInstance) ToItem

func (i VPNInstance) ToItem() map[string]types.AttributeValue

func (VPNInstance) UpdateExpression

func (i VPNInstance) UpdateExpression() (*expression.Expression, error)

type WireguardPeer

type WireguardPeer struct {
	IPAddress string `dynamodbav:"IPAddress"`
	PublicKey string `dynamodbav:"PublicKey"`
	Username  string `dynamodbav:"Username"`
}

func DynamoItemToWireguardPeer

func DynamoItemToWireguardPeer(item map[string]types.AttributeValue) (*WireguardPeer, error)

func DynamoItemsToWireguardPeers

func DynamoItemsToWireguardPeers(items []map[string]types.AttributeValue) ([]WireguardPeer, error)

func NewWireguardPeer

func NewWireguardPeer(ipAddress, publicKey, username string) *WireguardPeer

func (*WireguardPeer) PrimaryKey

func (p *WireguardPeer) PrimaryKey() map[string]types.AttributeValue

func (*WireguardPeer) RangeKey

func (p *WireguardPeer) RangeKey() map[string]types.AttributeValue

func (WireguardPeer) String

func (p WireguardPeer) String() string

func (*WireguardPeer) ToItem

func (p *WireguardPeer) ToItem() map[string]types.AttributeValue

Jump to

Keyboard shortcuts

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