api

package
v0.0.0-...-391253a Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2023 License: GPL-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NullAreaName     = "NullArea"
	NullEndPointName = "NullEndpoint"
	DefaultTimeout   = time.Second * 60
)
View Source
const (
	DeviceType1  = "Inverter"
	DeviceType10 = "String"
	DeviceType11 = "Plant"
	DeviceType12 = "Circuit Protection"
	DeviceType13 = "Splitting Device"
	DeviceType14 = "Energy Storage System"
	DeviceType15 = "Sampling Device"
	DeviceType16 = "EMU"
	DeviceType17 = "Unit"
	DeviceType18 = "Temperature and Humidity Sensor"
	DeviceType19 = "Intelligent Power Distribution Cabinet"
	DeviceType20 = "Display Device"
	DeviceType21 = "AC Power Distributed Cabinet"
	DeviceType22 = "Communication Module"
	DeviceType23 = "System-BMS"
	DeviceType24 = "RackBMS"
	DeviceType25 = "DC-DC"
	DeviceType26 = "Energy Management System"
	DeviceType28 = "Wind Energy Converter"
	DeviceType29 = "SVG"
	DeviceType3  = "Grid-connection Point"
	DeviceType30 = "PT Cabinet"
	DeviceType31 = "Bus Protection"
	DeviceType32 = "Cleaning Robot"
	DeviceType33 = "Direct Current Cabinet"
	DeviceType34 = "Public Measurement and Control"
	DeviceType35 = "Anti-islanding Protection Device"
	DeviceType36 = "Frequency and Voltage Emergency Control Device"
	DeviceType37 = "PCS"
	DeviceType38 = "Cell BMS"
	DeviceType39 = "Power Quality"
	DeviceType4  = "Combiner Box"
	DeviceType40 = "Shuttle"
	DeviceType41 = "Optimizer"
	DeviceType42 = "Tracking axis communication box"
	DeviceType43 = "Battery"
	DeviceType44 = "Battery Cluster Management Unit"
	DeviceType45 = "Local Controller"
	DeviceType46 = "Networking Devices"
	DeviceType47 = "Energy Storage Unit"
	DeviceType48 = "DC Container"
	DeviceType5  = "Meteo Station"
	DeviceType50 = "IO Module"
	DeviceType6  = "Transformer"
	DeviceType7  = "Meter"
	DeviceType8  = "UPS"
	DeviceType9  = "Data Logger"
	DeviceType99 = "Others"
)
View Source
const (
	DeviceNameInverter                                  = 1
	DeviceNameString                                    = 10
	DeviceNamePlant                                     = 11
	DeviceNameCircuitProtection                         = 12
	DeviceNameSplittingDevice                           = 13
	DeviceNameEnergyStorageSystem                       = 14
	DeviceNameSamplingDevice                            = 15
	DeviceNameEMU                                       = 16
	DeviceNameUnit                                      = 17
	DeviceNameTemperatureAndHumiditySensor              = 18
	DeviceNameIntelligentPowerDistributionCabinet       = 19
	DeviceNameDisplayDevice                             = 20
	DeviceNameACPowerDistributedCabinet                 = 21
	DeviceNameCommunicationModule                       = 22
	DeviceNameSystemBMS                                 = 23
	DeviceNameRackBMS                                   = 24
	DeviceNameDCToDC                                    = 25
	DeviceNameEnergyManagementSystem                    = 26
	DeviceNameWindEnergyConverter                       = 28
	DeviceNameSVG                                       = 29
	DeviceNameGridConnectionPoint                       = 3
	DeviceNamePTCabinet                                 = 30
	DeviceNameBusProtection                             = 31
	DeviceNameCleaningRobot                             = 32
	DeviceNameDirectCurrentCabinet                      = 33
	DeviceNamePublicMeasurementandControl               = 34
	DeviceNameAntiIslandingProtectionDevice             = 35
	DeviceNameFrequencyAndVoltageEmergencyControlDevice = 36
	DeviceNamePCS                                       = 37
	DeviceNameCellBMS                                   = 38
	DeviceNamePowerQuality                              = 39
	DeviceNameCombinerBox                               = 4
	DeviceNameShuttle                                   = 40
	DeviceNameOptimizer                                 = 41
	DeviceNameTrackingAxisCommunicationBox              = 42
	DeviceNameBattery                                   = 43
	DeviceNameBatteryClusterManagementUnit              = 44
	DeviceNameLocalController                           = 45
	DeviceNameNetworkingDevices                         = 46
	DeviceNameEnergyStorageUnit                         = 47
	DeviceNameDCContainer                               = 48
	DeviceNameMeteoStation                              = 5
	DeviceNameIOModule                                  = 50
	DeviceNameTransformer                               = 6
	DeviceNameMeter                                     = 7
	DeviceNameUPS                                       = 8
	DeviceNameDataLogger                                = 9
	DeviceNameOthers                                    = 99
)
View Source
const DEBUG = false

DEBUG - Used for easy debugging of this package.

View Source
const LastEntry = -1
View Source
const (
	VirtualPsId = "virtual"
)

Variables

View Source
var Points = PointsMap{
	Map: map[string]*Point{},
}

Points Discovered points from the API

Functions

func AppendUrl

func AppendUrl(host string, endpoint string) *url.URL

func CheckString

func CheckString(name string, rc string) error

CheckString RequestCommon checks

func GetPercent

func GetPercent(value float64, max float64, precision int) float64

func GetUrl

func GetUrl(u string) *url.URL

func HelpDataType

func HelpDataType() string

func HelpDateId

func HelpDateId() string

func HelpQueryType

func HelpQueryType() string

func HelpReportType

func HelpReportType() string

func JoinWithDots

func JoinWithDots(intSize int, dateFormat string, args ...interface{}) string

func MarshalJSON

func MarshalJSON(endpoint EndPoint) ([]byte, error)

Types

type Api

type Api struct{}

type Area

type Area interface {
	Init(*Web) AreaStruct
	GetAreaName() AreaName
	GetEndPoints() TypeEndPoints
	Call(name EndPointName) output.Json
	SetRequest(name EndPointName, ref interface{}) error
	GetRequest(name EndPointName) output.Json
	GetResponse(name EndPointName) output.Json
	GetData(name EndPointName) output.Json
	IsValid(name EndPointName) error
	GetError(name EndPointName) error
}

type AreaName

type AreaName string

func GetArea

func GetArea(v interface{}) AreaName

func (AreaName) String

func (an AreaName) String() string

type AreaNames

type AreaNames []AreaName

type AreaStruct

type AreaStruct struct {
	ApiRoot   interface{} // *web.Web
	Name      AreaName
	EndPoints TypeEndPoints
	Error     error
}

func (AreaStruct) CountDisabled

func (as AreaStruct) CountDisabled() int

func (AreaStruct) CountEnabled

func (as AreaStruct) CountEnabled() int

func (AreaStruct) CoveragePercent

func (as AreaStruct) CoveragePercent() float64

func (AreaStruct) Exists

func (as AreaStruct) Exists(name EndPointName) error

func (*AreaStruct) GetEndPoint

func (as *AreaStruct) GetEndPoint(name EndPointName) EndPoint

func (AreaStruct) ListEndpoints

func (as AreaStruct) ListEndpoints()

func (*AreaStruct) SortEndPoints

func (as *AreaStruct) SortEndPoints() []EndPointName

type Areas

type Areas map[AreaName]AreaStruct // TypeEndPoints		// Map of EndPoints by area name.

func (*Areas) EndpointExists

func (an *Areas) EndpointExists(area AreaName, name EndPointName) error

func (*Areas) Exists

func (an *Areas) Exists(area string) bool

func (*Areas) GetArea

func (an *Areas) GetArea(area AreaName) *Area

func (*Areas) GetEndPoint

func (an *Areas) GetEndPoint(area AreaName, endpoint EndPointName) EndPoint

func (*Areas) GetRequest

func (an *Areas) GetRequest(area AreaName, endpoint EndPointName) output.Json

func (*Areas) GetResponse

func (an *Areas) GetResponse(area AreaName, endpoint EndPointName) output.Json

func (Areas) ListAreas

func (an Areas) ListAreas()

func (Areas) ListEndpoints

func (an Areas) ListEndpoints(area string) error

func (*Areas) NotExists

func (an *Areas) NotExists(area string) bool

func (*Areas) RequestArgs

func (an *Areas) RequestArgs(area AreaName, endpoint EndPointName) map[string]string

func (*Areas) RequestRequiresArgs

func (an *Areas) RequestRequiresArgs(area AreaName, endpoint EndPointName) bool

func (*Areas) SetRequest

func (an *Areas) SetRequest(area AreaName, endpoint EndPointName, ref interface{}) error

func (*Areas) SortAreas

func (an *Areas) SortAreas() AreaNames

type DataEntries

type DataEntries struct {
	Entries []DataEntry
}

func CreatePointDataEntries

func CreatePointDataEntries(Current *GoStruct.Reflect, parentDeviceId string, point Point, dateTime valueTypes.DateTime) DataEntries

func (*DataEntries) Add

func (de *DataEntries) Add(ref DataEntry) *DataEntries

func (*DataEntries) GetEntry

func (de *DataEntries) GetEntry(index int) *DataEntry

func (*DataEntries) Len

func (de *DataEntries) Len() int

type DataEntry

type DataEntry struct {
	Current  *GoStruct.Reflect    `json:"-"`
	EndPoint string               `json:"endpoint"`
	Point    *Point               `json:"point"`
	Parent   ParentDevice         `json:"parent"`
	Date     valueTypes.DateTime  `json:"date"`
	Value    valueTypes.UnitValue `json:"value"`

	Valid bool `json:"valid"`
	Hide  bool `json:"hide"`
}

func CreatePointDataEntry

func CreatePointDataEntry(Current *GoStruct.Reflect, parentDeviceId string, point Point, dateTime valueTypes.DateTime, uv valueTypes.UnitValue) DataEntry

func (*DataEntry) IsNotValid

func (de *DataEntry) IsNotValid() bool

func (*DataEntry) IsValid

func (de *DataEntry) IsValid() bool

type DataMap

type DataMap struct {
	Map map[string]*DataEntries

	TimeStamp    time.Time
	EndPointPath GoStruct.EndPointPath
	StructMap    GoStruct.StructMap
	EndPoint     EndPoint
	Debug        bool
	Error        error
	// contains filtered or unexported fields
}

func NewDataMap

func NewDataMap() DataMap

func (*DataMap) Add

func (dm *DataMap) Add(des ...DataEntry)

func (*DataMap) AddPointUnitValues

func (dm *DataMap) AddPointUnitValues(Current *GoStruct.Reflect, parentDeviceId string, date valueTypes.DateTime)

func (*DataMap) AppendMap

func (dm *DataMap) AppendMap(add DataMap)

func (*DataMap) CopyPoint

func (dm *DataMap) CopyPoint(refEndpoint *GoStruct.Reflect, endpoint GoStruct.EndPointPath, pointId string, pointName string) *GoStruct.Reflect

func (*DataMap) CopyPointFromName

func (dm *DataMap) CopyPointFromName(refEndpoint string, endpoint GoStruct.EndPointPath, pointId string, pointName string) *GoStruct.Reflect

func (*DataMap) CreateDataTables

func (dm *DataMap) CreateDataTables() Tables

func (*DataMap) CreateResultTable

func (dm *DataMap) CreateResultTable(full bool) output.Table

func (*DataMap) GetPercent

func (dm *DataMap) GetPercent(entry *GoStruct.Reflect, max *GoStruct.Reflect, precision int) float64

func (*DataMap) GetReflect

func (dm *DataMap) GetReflect(refEndpoint string) *GoStruct.Reflect

func (*DataMap) LowerUpper

func (dm *DataMap) LowerUpper(lowerEntry *GoStruct.Reflect, upperEntry *GoStruct.Reflect) float64

func (*DataMap) MakeState

func (dm *DataMap) MakeState(Current *GoStruct.Reflect) *GoStruct.Reflect

func (*DataMap) ProcessMap

func (dm *DataMap) ProcessMap()

func (*DataMap) Sort

func (dm *DataMap) Sort() []string

func (DataMap) String

func (dm DataMap) String() string

func (*DataMap) StructToDataMap

func (dm *DataMap) StructToDataMap(endpoint EndPoint, parentDeviceId string, name GoStruct.EndPointPath) DataMap

type EndPoint

type EndPoint interface {
	GetArea() AreaName
	GetName() EndPointName
	GetUrl() EndPointUrl
	IsDisabled() bool
	Help() string
	IsDebug() bool

	Call() EndPoint
	SetError(string, ...interface{}) EndPoint
	GetError() error
	IsError() bool
	MarshalJSON() ([]byte, error)
	ReadDataFile() error
	WriteDataFile() error
	String() string
	GetJsonData(bool) output.Json

	SetRequest(ref interface{}) EndPoint // EndPointStruct
	SetRequestByJson(j output.Json) EndPoint
	RequestRef() interface{}
	GetRequestJson() output.Json
	IsRequestValid() error
	RequestString() string
	RequestFingerprint() string
	GetRequestArgNames() map[string]string

	SetResponse([]byte) EndPoint // EndPointStruct
	ResponseRef() interface{}
	GetResponseJson() output.Json
	IsResponseValid() error
	ResponseString() string

	CacheFilename() string
	SetCacheTimeout(duration time.Duration) EndPoint
	GetCacheTimeout() time.Duration

	// GetDataTable() output.Table
	GetEndPointData() DataMap
	GetEndPointResultTable() output.Table
	GetEndPointDataTables() output.Tables
	SetFilenamePrefix(format string, args ...interface{}) string
}

type EndPointName

type EndPointName string

func GetName

func GetName(v interface{}) EndPointName

func (EndPointName) String

func (n EndPointName) String() string

type EndPointStruct

type EndPointStruct struct {
	ApiRoot     Web `json:"-"`
	RawResponse []byte

	Area           AreaName     `json:"area"`
	Name           EndPointName `json:"name"`
	Url            EndPointUrl  `json:"url"`
	FileNamePrefix string
	Request        interface{} `json:"-"`
	Response       interface{} `json:"-"`
	Error          error       `json:"-"`
	Debug          bool        `json:"-"`
}

func (*EndPointStruct) ApiCacheFilename

func (ep *EndPointStruct) ApiCacheFilename(request interface{}) string

func (*EndPointStruct) ApiFingerprint

func (ep *EndPointStruct) ApiFingerprint(request interface{}) string

func (*EndPointStruct) ApiGetJsonFilename

func (ep *EndPointStruct) ApiGetJsonFilename() string

func (EndPointStruct) ApiGetRequestArgNames

func (ep EndPointStruct) ApiGetRequestArgNames(req interface{}) map[string]string

func (*EndPointStruct) ApiIsDebug

func (ep *EndPointStruct) ApiIsDebug() bool

func (*EndPointStruct) ApiReadDataFile

func (ep *EndPointStruct) ApiReadDataFile(ref interface{}) error

ApiReadDataFile - Retrieves data from a local file.

func (*EndPointStruct) ApiRemoveDataFile

func (ep *EndPointStruct) ApiRemoveDataFile() error

ApiRemoveDataFile - Saves data to a file path.

func (*EndPointStruct) ApiSetFilenamePrefix

func (ep *EndPointStruct) ApiSetFilenamePrefix(format string, args ...interface{}) string

func (*EndPointStruct) ApiWriteDataFile

func (ep *EndPointStruct) ApiWriteDataFile(ref interface{}) error

ApiWriteDataFile - Saves data to a file path.

func (*EndPointStruct) Call

func (ep *EndPointStruct) Call() output.Json

func (*EndPointStruct) FileExists

func (ep *EndPointStruct) FileExists(fn string) bool

FileExists Checks for existence of a local file.

func (*EndPointStruct) GetArea

func (ep *EndPointStruct) GetArea() AreaName

func (*EndPointStruct) GetFilePath

func (ep *EndPointStruct) GetFilePath() string

func (*EndPointStruct) GetName

func (ep *EndPointStruct) GetName() EndPointName

func (*EndPointStruct) GetRequest

func (ep *EndPointStruct) GetRequest() output.Json

func (*EndPointStruct) GetResponse

func (ep *EndPointStruct) GetResponse() output.Json

func (*EndPointStruct) GetUrl

func (ep *EndPointStruct) GetUrl() EndPointUrl

func (*EndPointStruct) IsValid

func (ep *EndPointStruct) IsValid() error

func (EndPointStruct) ResponseAsJson

func (ep EndPointStruct) ResponseAsJson(raw bool, r interface{}) output.Json

func (*EndPointStruct) SetRequest

func (ep *EndPointStruct) SetRequest(ref interface{}) error

func (EndPointStruct) String

func (ep EndPointStruct) String() string

type EndPointUrl

type EndPointUrl struct {
	EndPoint *url.URL `json:"endpoint"`
	Error    error    `json:"error"`
}

func SetUrl

func SetUrl(endpoint string) EndPointUrl

func (EndPointUrl) AppendPath

func (u EndPointUrl) AppendPath(endpoint string) EndPointUrl

func (*EndPointUrl) IsValid

func (u *EndPointUrl) IsValid() error

func (*EndPointUrl) MarshalJSON

func (u *EndPointUrl) MarshalJSON() ([]byte, error)

func (EndPointUrl) String

func (u EndPointUrl) String() string

func (*EndPointUrl) UnmarshalJSON

func (u *EndPointUrl) UnmarshalJSON(data []byte) error

type ParentDevice

type ParentDevice struct {
	Key  string `json:"ps_key"`
	PsId string `json:"ps_id"`
	Type string `json:"parent_type"`
	Code string `json:"parent_code"`
}

func NewParentDevice

func NewParentDevice(key string) ParentDevice

func (*ParentDevice) HasChanged

func (pd *ParentDevice) HasChanged(comp ParentDevice) bool

func (*ParentDevice) Set

func (pd *ParentDevice) Set(key string)

func (*ParentDevice) Split

func (pd *ParentDevice) Split()

type ParentDevices

type ParentDevices struct {
	Map   map[string]*ParentDevice
	Index []string
}

func (*ParentDevices) Add

func (pd *ParentDevices) Add(device ParentDevice)

func (*ParentDevices) Codes

func (pd *ParentDevices) Codes() string

func (*ParentDevices) Keys

func (pd *ParentDevices) Keys() string

func (*ParentDevices) PsIds

func (pd *ParentDevices) PsIds() string

func (ParentDevices) String

func (pd ParentDevices) String() string

func (*ParentDevices) Types

func (pd *ParentDevices) Types() string

type Point

type Point struct {
	Parents     ParentDevices     `json:"parents,omitempty"`
	Id          string            `json:"id,omitempty"`
	GroupName   string            `json:"group_name,omitempty"`
	Description string            `json:"description,omitempty"`
	Unit        string            `json:"unit,omitempty"`
	UpdateFreq  string            `json:"time_span,omitempty"`
	ValueType   string            `json:"value_type,omitempty"`
	Valid       bool              `json:"valid,omitempty"`
	States      map[string]string `json:"states,omitempty"`
}

func CreatePoint

func CreatePoint(Current *GoStruct.Reflect, parentDeviceId string) Point

func GetDevicePoint

func GetDevicePoint(devicePoint string) *Point

func GetPoint

func GetPoint(point string) *Point

func (*Point) FixUnitType

func (p *Point) FixUnitType() Point

func (*Point) HasChanged

func (p *Point) HasChanged(comp Point) bool

func (*Point) HasNotChanged

func (p *Point) HasNotChanged(comp Point) bool

func (Point) Is15Minute

func (p Point) Is15Minute() bool

func (Point) Is30Minute

func (p Point) Is30Minute() bool

func (Point) Is5Minute

func (p Point) Is5Minute() bool

func (Point) IsBool

func (p Point) IsBool() bool

func (Point) IsBoot

func (p Point) IsBoot() bool

func (Point) IsDaily

func (p Point) IsDaily() bool

func (Point) IsInstant

func (p Point) IsInstant() bool

func (Point) IsMonthly

func (p Point) IsMonthly() bool

func (Point) IsTotal

func (p Point) IsTotal() bool

func (Point) IsYearly

func (p Point) IsYearly() bool

func (*Point) SetName

func (p *Point) SetName(name string)

func (Point) String

func (p Point) String() string

func (*Point) WhenReset

func (p *Point) WhenReset(date valueTypes.DateTime) string

type PointsMap

type PointsMap struct {
	Map map[string]*Point
}

func (*PointsMap) Add

func (pm *PointsMap) Add(point Point) bool

func (*PointsMap) Exists

func (pm *PointsMap) Exists(pid string) bool

func (*PointsMap) Get

func (pm *PointsMap) Get(point string) *Point

func (*PointsMap) GetDevicePoint

func (pm *PointsMap) GetDevicePoint(devicePoint string) *Point

func (*PointsMap) Print

func (pm *PointsMap) Print()

func (*PointsMap) Resolve

func (pm *PointsMap) Resolve(point string) *Point

type Request

type Request struct {
	RequestCommon
}

type RequestCommon

type RequestCommon struct {
	Appkey    string `json:"appkey" required:"true"`
	Lang      string `json:"lang"`
	SysCode   string `json:"sys_code" required:"true"`
	Token     string `json:"token"`
	UserId    string `json:"user_id"`
	ValidFlag string `json:"valid_flag"`
}

func (RequestCommon) IsValid

func (req RequestCommon) IsValid() error

func (RequestCommon) String

func (req RequestCommon) String() string

type Response

type Response struct {
	ResponseCommon
}

type ResponseCommon

type ResponseCommon struct {
	ReqSerialNum string `json:"req_serial_num"`
	ResultCode   string `json:"result_code"`
	ResultMsg    string `json:"result_msg"`
}

func (ResponseCommon) CheckResultCode

func (req ResponseCommon) CheckResultCode() error

func (ResponseCommon) CheckResultMessage

func (req ResponseCommon) CheckResultMessage() error

func (ResponseCommon) IsTokenInvalid

func (req ResponseCommon) IsTokenInvalid() bool

func (ResponseCommon) IsTokenValid

func (req ResponseCommon) IsTokenValid() bool

func (ResponseCommon) IsValid

func (req ResponseCommon) IsValid() error

func (ResponseCommon) String

func (req ResponseCommon) String() string

type Tables

type Tables GoStruct.StructTables

type TemplatePoint

type TemplatePoint struct {
	Name    string
	PsKey   string
	PointId valueTypes.PointId
	Unit    string
}

type TemplatePoints

type TemplatePoints []TemplatePoint

func CreatePoints

func CreatePoints(points []string) TemplatePoints

func (*TemplatePoints) GetPoint

func (t *TemplatePoints) GetPoint(pskey string, point valueTypes.PointId) TemplatePoint

func (*TemplatePoints) PrintKeys

func (t *TemplatePoints) PrintKeys() string

func (*TemplatePoints) PrintPoints

func (t *TemplatePoints) PrintPoints() string

type TypeEndPoints

type TypeEndPoints map[EndPointName]EndPoint // Map of EndPoints by endpoint name.

func (TypeEndPoints) Exists

func (ps TypeEndPoints) Exists(name EndPointName) error

func (*TypeEndPoints) GetDisabled

func (ps *TypeEndPoints) GetDisabled() TypeEndPoints

func (*TypeEndPoints) GetEnabled

func (ps *TypeEndPoints) GetEnabled() TypeEndPoints

func (*TypeEndPoints) GetEndPoint

func (ps *TypeEndPoints) GetEndPoint(name EndPointName) EndPoint

func (*TypeEndPoints) SortEndPoints

func (ps *TypeEndPoints) SortEndPoints() []EndPointName

func (TypeEndPoints) String

func (ps TypeEndPoints) String() string

type Web

type Web struct {
	ServerUrl EndPointUrl
	Body      []byte
	Error     error
	// contains filtered or unexported fields
}

func (*Web) ApiGetEndPointDataTables

func (w *Web) ApiGetEndPointDataTables(endpoint EndPoint) output.Tables

func (*Web) ApiGetEndPointResultTable

func (w *Web) ApiGetEndPointResultTable(endpoint EndPoint) output.Table

func (*Web) AppendUrl

func (w *Web) AppendUrl(endpoint string) EndPointUrl

func (*Web) Get

func (w *Web) Get(endpoint EndPoint) EndPoint

func (*Web) GetCacheDir

func (w *Web) GetCacheDir() string

func (*Web) GetCacheTimeout

func (w *Web) GetCacheTimeout() time.Duration

func (*Web) PointCacheCheck

func (w *Web) PointCacheCheck(data DataMap) bool

PointCacheCheck Retrieves cache data from a local file.

func (*Web) PointCacheRead

func (w *Web) PointCacheRead(endpoint EndPoint) ([]byte, error)

PointCacheRead Retrieves cache data from a local file.

func (*Web) PointCacheWrite

func (w *Web) PointCacheWrite(endpoint EndPoint, data []byte) error

PointCacheWrite Saves cache data to a file path.

func (*Web) SetCacheDir

func (w *Web) SetCacheDir(basedir string) error

func (*Web) SetCacheTimeout

func (w *Web) SetCacheTimeout(duration time.Duration)

func (*Web) SetUrl

func (w *Web) SetUrl(u string) error

func (*Web) WebCacheCheck

func (w *Web) WebCacheCheck(endpoint EndPoint) bool

WebCacheCheck Retrieves cache data from a local file.

func (*Web) WebCacheRead

func (w *Web) WebCacheRead(endpoint EndPoint) ([]byte, error)

WebCacheRead Retrieves cache data from a local file.

func (*Web) WebCacheRemove

func (w *Web) WebCacheRemove(endpoint EndPoint) error

WebCacheRemove Removes a cache file.

func (*Web) WebCacheWrite

func (w *Web) WebCacheWrite(endpoint EndPoint, data []byte) error

WebCacheWrite Saves cache data to a file path.

Directories

Path Synopsis
Package GoStruct - A framework for type agnostic and recursive data.
Package GoStruct - A framework for type agnostic and recursive data.
gojson
Package gojson - generates go struct defintions from JSON documents
Package gojson - generates go struct defintions from JSON documents

Jump to

Keyboard shortcuts

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