models

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PortMapping

type PortMapping struct {
	Duration    int    `json:"duration"`    // duration in seconds
	Endpoint    string `json:"endpoint"`    // SORACOM Napter endpoint
	Hostname    string `json:"hostname"`    // SORACOM Napter hostname
	IPAddress   string `json:"ipAddress"`   // SORACOM Napter IP address
	Port        int    `json:"port"`        // SORACOM Napter port number
	TLSRequired bool   `json:"tlsRequired"` // is TLS required
	Destination struct {
		ID   string `json:"simId"` // target SIM ID
		Port int    `json:"port"`  // target port
	} `json:"destination"`
	Source struct {
		IPRanges []string `json:"ipRanges"` // permitted source CIDRs
	} `json:"source"`
}

A PortMapping represents SORACOM Napter port mapping

func (PortMapping) String

func (pm PortMapping) String() string

type SIM

type SIM struct {
	ActiveProfileID string `json:"activeProfileId"`
	ID              string `json:"simId"`      // IMSI of the subscriber
	SpeedClass      string `json:"speedClass"` // speed class e.g. s1.4xfast

	Profiles map[string]struct {
		PrimaryImsi string `json:"primaryImsi"`
		Subscribers map[string]struct {
			Imsi         string `json:"imsi"`
			Subscription string `json:"subscription"` // subscription e.g. plan01s, plan-D
		} `json:"subscribers"`
	} `json:"profiles"`
	SessionStatus struct {
		Online bool   `json:"online"` // represents subscriber is online or not
		Imsi   string `json:"imsi"`
	} `json:"sessionStatus"`
	Tags struct {
		Name string `json:"name,omitempty"` // name of the subscriber
	} `json:"tags"`
}

A SIM represents a SORACOM IoT SIM

func (SIM) ActiveSubscription

func (s SIM) ActiveSubscription() string

func (SIM) Description

func (s SIM) Description() string

Description returns subscription and type (speed class) as its description of the SIM, for interactive command

func (SIM) FilterValue

func (s SIM) FilterValue() string

FilterValue uses all fields as source of filter value of the SIM, for interactive command

func (SIM) String

func (s SIM) String() string

func (SIM) Title

func (s SIM) Title() string

Title returns SIM ID and name as its title of the SIM, for interactive command

Jump to

Keyboard shortcuts

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