api

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: May 20, 2024 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidatePathIndex

func ValidatePathIndex(id string) (string, error)

ValidatePathIndex unescapes and validates a Modem ID string by replacing "%2f" and "%2F" with "/"

Types

type Api

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

func Provide

func Provide(be backend.Backend) *Api

func (*Api) LocationGet

func (a *Api) LocationGet(w http.ResponseWriter, r *http.Request)

LocationGet @Summary Get location @Accept json @Produce json @Tags location @Success 200 @Failure 404 {object} http.ErrorResponse @Router /location [get] @Param modem query string false "Modem-Id"

func (*Api) ModemDetail

func (a *Api) ModemDetail(w http.ResponseWriter, r *http.Request)

ModemDetail @Summary Modem info @Accept json @Produce json @Tags modem @Success 200 @Failure 404 {object} http.ErrorResponse @Router /modem/{id} [get] @Param id path string true "Modem-Id"

func (*Api) ModemList

func (a *Api) ModemList(w http.ResponseWriter, r *http.Request)

ModemList @Summary List modems @Accept json @Produce json @Tags modem @Success 200 @Router /modem/ [get]

func (*Api) SmsDelete

func (a *Api) SmsDelete(w http.ResponseWriter, r *http.Request)

SmsDelete @Summary Delete a single SMS @Accept json @Produce json @Tags sms @Success 200 @Router /sms/{id} [delete] @Param id path string true "SMS-Id"

func (*Api) SmsGet

func (a *Api) SmsGet(w http.ResponseWriter, r *http.Request)

SmsGet @Summary List SMS messages @Accept json @Produce json @Tags sms @Success 200 @Failure 404 {object} http.ErrorResponse @Router /sms/ [get] @Router /sms/{id} [get] @Param id path string true "SMS-Id" @Param modem query string false "Modem-Id"

func (*Api) SmsSend

func (a *Api) SmsSend(w http.ResponseWriter, r *http.Request)

SmsSend @Summary Send SMS @Accept json @Produce json @Tags sms @Success 200 @Param data body SmsRequestData true "Data" @Router /sms [post] @Param modem query string false "Modem-Id"

type Response

type Response struct {
	Message string `json:"message"`
}

type SmsCreated

type SmsCreated struct {
	Modem struct {
		Messaging struct {
			CreatedSms string `json:"created-sms"`
		} `json:"messaging"`
	} `json:"modem"`
}

SmsCreated {"modem":{"messaging":{"created-sms":"/org/freedesktop/ModemManager1/SMS/0"}}}

type SmsRequestData

type SmsRequestData struct {
	Number string `json:"number" example:"+431234567890"`
	Text   string `json:"text" example:"Ping"`
}

type Utils

type Utils struct {
}

func ProvideUtilsApi

func ProvideUtilsApi() *Utils

func (*Utils) Ping

func (u *Utils) Ping(w http.ResponseWriter, r *http.Request)

Ping @Summary ping @Accept plain @Produce plain @Tags utils @Success 200 {string} boing @Router /ping [get] @Security JWT

Jump to

Keyboard shortcuts

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