acs

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2023 License: MIT Imports: 25 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetState

func GetState(typ string, name string) bool

func SendHttpConnetionRequest

func SendHttpConnetionRequest(url string, username string, password string) (bool, error)

func SendUDPConnectionRequest

func SendUDPConnectionRequest(addr string, username string, password string) (bool, error)

func SetState

func SetState(typ string, name string, v bool)

Types

type AcsHanlder

type AcsHanlder interface {
	GetProduct(schema string, oui string, productClass string) Product
	GetDevice(schema string, oui string, productClass string, serialNumber string) Device

	HandleInform(ctx context.Context, inform *proto.Inform) error
	HandleFault(device Device, id string, v *proto.SoapFault) error

	HandleTransferComplete(ctx context.Context, device Device, req *proto.TransferComplete) error
	HandleAutonomousTransferComplete(ctx context.Context, device Device, req *proto.AutonomousTransferComplete) error
	HandleGetRPCMethodsResponse(ctx context.Context, device Device, id string, resp *proto.GetRPCMethodsResponse) error
	HandleGetParameterValuesResponse(ctx context.Context, device Device, id string, resp *proto.GetParameterValuesResponse) error
	HandleSetParameterValuesResponse(ctx context.Context, device Device, id string, resp *proto.SetParameterValuesResponse) error
	HandleGetParameterNamesResponse(ctx context.Context, device Device, id string, resp *proto.GetParameterNamesResponse) error
	HandleGetParameterAttributesResponse(ctx context.Context, device Device, id string, resp *proto.GetParameterAttributesResponse) error
	HandleSetParameterAttributesResponse(ctx context.Context, device Device, id string, resp *proto.SetParameterAttributesResponse) error
	HandleAddObjectResponse(ctx context.Context, device Device, id string, resp *proto.AddObjectResponse) error
	HandleDeleteObjectResponse(ctx context.Context, device Device, id string, resp *proto.DeleteObjectResponse) error
	HandleDownloadResponse(ctx context.Context, device Device, id string, resp *proto.DownloadResponse) error
	HandleUploadResponse(ctx context.Context, device Device, id string, resp *proto.UploadResponse) error
	HandleRebootResponse(ctx context.Context, device Device, id string, resp *proto.RebootResponse) error
	HandleFactoryResetResponse(ctx context.Context, device Device, id string, resp *proto.FactoryResetResponse) error

	HandleMesureValues(device Device, filename string, values map[string]any)
}

type AcsServer

type AcsServer struct {
	// contains filtered or unexported fields
}

func NewAcsServer

func NewAcsServer(handler AcsHanlder, dataRetentionPeriod time.Duration) *AcsServer

func (*AcsServer) HandlePost

func (s *AcsServer) HandlePost(c echo.Context) error

func (*AcsServer) HandleUpload

func (s *AcsServer) HandleUpload(c echo.Context) error

func (*AcsServer) SetupPostEchoGroup

func (s *AcsServer) SetupPostEchoGroup(group *echo.Group, sessionStore sessions.Store) *echo.Group

func (*AcsServer) SetupPostEchoGroupWithOptions

func (s *AcsServer) SetupPostEchoGroupWithOptions(group *echo.Group, sessionStore sessions.Store, opts Options) *echo.Group

func (*AcsServer) SetupUploadEchoGroup

func (s *AcsServer) SetupUploadEchoGroup(group *echo.Group) *echo.Group

type AuthType

type AuthType string
const (
	AuthTypeNone  AuthType = "None"
	AuthTypeBasic AuthType = "Basic"
)

type DataModel

type DataModel interface {
	GetParameterType(name string) string
}

type Device

type Device interface {
	GetProduct() Product
	GetNextMethodCall() MethodCall
	GetMethodCall(commandKey string) MethodCall
	PushMethodCall(t time.Time, methodName string, values map[string]any) (MethodCall, error)
	UpdateMethodCallRequestSend(commandKey string) error
	UpdateMethodCallResponse(commandKey string, values map[string]any, faultÇode int, faultString string) error
	UpdateMethodCallUnknow(commandKey string) error
}

type MethodCall

type MethodCall interface {
	GetMethodName() string
	GetCommandKey() string
	GetRequestValues() map[string]string
	GetRequestValue(n string) string
}

type Options

type Options struct {
	AuthType     AuthType
	AuthUsername string
	AuthPassword string
	DumpBody     bool
}

type Product

type Product interface {
	GetDataModel() DataModel
}

Jump to

Keyboard shortcuts

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