amrreader

package module
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2025 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Header(hostname string) callx.Header

Types

type Account

type Account struct {
	Header       callx.Header
	MeterNo      string
	MeterPoint   string
	CustomerId   string
	CustomerCode string
}

type AmrX

type AmrX interface {
	Auth(config Credential) (*Session, error)
	GetAccount(session Session) (*Account, error)
	GetProfileDaily(acc Account, date string) (*ProfileMeter, error)
	PasswordRotation(config PasswordRotationCredential, header *callx.Header) (*Session, error)
	Logout() error
}

func New

func New(config Config, callX callx.CallX) AmrX

type Config

type Config struct {
	BaseURL string
	Logger  bool
}

func (Config) Hostname added in v1.1.0

func (c Config) Hostname() string

type Credential

type Credential struct {
	Username string
	Password string
}

func (*Credential) Checksum

func (c *Credential) Checksum() string

type Logger added in v1.1.0

type Logger struct {
	Enabled bool
}

func (Logger) Error added in v1.1.0

func (l Logger) Error(msg string, args ...any)

func (Logger) Fatal added in v1.1.0

func (l Logger) Fatal(v ...any)

func (Logger) Info added in v1.1.0

func (l Logger) Info(msg string, args ...any)

type PasswordRotationCredential added in v1.2.0

type PasswordRotationCredential struct {
	Username    string
	OldPassword string
	NewPassword string
}

type Profile

type Profile struct {
	Time              *time.Time `json:"time"`
	EnergyConsumption *float64   `json:"energyConsumption"`
}

type ProfileMeter

type ProfileMeter struct {
	CustomerId   string    `json:"customerId"`
	CustomerCode string    `json:"customerCode"`
	MeterNo      string    `json:"meterNo"`
	MeterPoint   string    `json:"meterPoint"`
	Profile      []Profile `json:"profile"`
}

type Session added in v1.1.1

type Session struct {
	Header   callx.Header
	Username string
}

Jump to

Keyboard shortcuts

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