Documentation ¶
Index ¶
- Constants
- func IsSpeedLimitEqual(speedLimitEnable *bool, speedLimit *int, speedLimitType *int, ...) bool
- func NewBool(b bool) *bool
- func NewInt(num int) *int
- func NewStr(str string) *string
- type Controller
- type Data
- type NetworksResponse
- type NetworksSsidRequest
- type OmadaApi
- type OmadaLoginData
- type OmadaResponse
- type OmadaTimeRangeData
- type PskSetting
- type RateAndBeaconCtrl
- type RateLimit
- type Repository
- func (r *Repository) CreateTimeRange(omadaControllerId *string, cookies []*http.Cookie, loginToken *string, ...) (*OmadaResponse, error)
- func (r *Repository) CreateUrlFilter(omadaControllerId *string, cookies []*http.Cookie, loginToken *string, ...) (*OmadaResponse, error)
- func (r *Repository) DeleteUrlFilter(omadaControllerId *string, cookies []*http.Cookie, loginToken *string, ...) (*OmadaResponse, error)
- func (r *Repository) GetControllerId() (*OmadaResponse, error)
- func (r *Repository) GetSites(omadaControllerId *string, cookies []*http.Cookie, loginToken *string) (*OmadaResponse, error)
- func (r *Repository) GetSsids(omadaControllerId *string, cookies []*http.Cookie, loginToken *string, ...) (*OmadaResponse, error)
- func (r *Repository) GetTimeRanges(omadaControllerId *string, cookies []*http.Cookie, loginToken *string, ...) (*OmadaResponse, error)
- func (r *Repository) GetWlans(omadaControllerId *string, cookies []*http.Cookie, loginToken *string, ...) (*OmadaResponse, error)
- func (r *Repository) Login(omadaControllerId *string) (*OmadaResponse, []*http.Cookie, error)
- func (r *Repository) QueryUrlFilters(omadaControllerId *string, cookies []*http.Cookie, loginToken *string, ...) (*OmadaResponse, error)
- func (r *Repository) UpdateSsid(omadaControllerId *string, cookies []*http.Cookie, loginToken *string, ...) (*OmadaResponse, error)
- func (r *Repository) UpdateUrlFilter(omadaControllerId *string, cookies []*http.Cookie, loginToken *string, ...) (*OmadaResponse, error)
- type Result
- type TimeList
- type UrlFilter
- type UrlFilterController
- type WpaSetting
Constants ¶
View Source
const BYPASS_FILTERING = 1
View Source
const DISABLED = -1
View Source
const ENABLE_FILTERING = 0
View Source
const SSID_SOURCE_TYPE = 2
View Source
const (
// Wifis return list of sites for network controller
Wifis = networksPrefix + "/wifis/{ssid}"
)
Variables ¶
This section is empty.
Functions ¶
func IsSpeedLimitEqual ¶
Types ¶
type Controller ¶
type Controller interface { GetWifi(w http.ResponseWriter, r *http.Request) UpdateWifi(w http.ResponseWriter, r *http.Request) }
func NewController ¶
func NewController(config *config.Configuration) Controller
Creates new networks controller
func NewControllerWithParams ¶
func NewControllerWithParams(config *config.Configuration, ufc UrlFilterController, r Repository) Controller
Creates a new controller with additional dependencies for tests
type Data ¶
type Data struct { // common params Id *string `json:"id,omitempty"` Name *string `json:"name,omitempty"` SiteId *string `json:"siteid,omitempty"` Policy *int `json:"policy,omitempty"` // ssid params Band *int `json:"band,omitempty"` WlanId *string `json:"wlanid,omitempty"` VlanEnable *bool `json:"vlanEnable,omitempty"` VlanId *int `json:"vlanId,omitempty"` Broadcast *bool `json:"broadcast,omitempty"` Security *int `json:"security,omitempty"` GuestNetEnable *bool `json:"guestNetEnable,omitempty"` WlanScheduleEnable *bool `json:"wlanScheduleEnable,omitempty"` Action *int `json:"action,omitempty"` ScheduleId *string `json:"scheduleId,omitempty"` MacFilterEnable *bool `json:"macFilterEnable,omitempty"` MacFilterId *string `json:"macFilterId,omitempty"` RateLimit *RateLimit `json:"rateLimit,omitempty"` PskSetting *PskSetting `json:"pskSetting,omitempty"` WpaSetting *WpaSetting `json:"wpaSetting,omitempty"` RateAndBeaconCtrl *RateAndBeaconCtrl `json:"rateAndBeaconCtrl,omitempty"` // time range params DayMode *int `json:"dayMode,omitempty"` TimeList *[]TimeList `json:"timeList,omitempty"` DayMon *bool `json:"dayMon,omitempty"` DayTue *bool `json:"dayTue,omitempty"` DayWed *bool `json:"dayWed,omitempty"` DayThu *bool `json:"dayThu,omitempty"` DayFri *bool `json:"dayFri,omitempty"` DaySat *bool `json:"daySat,omitempty"` DaySun *bool `json:"daySun,omitempty"` // url filtering EntryId *int `json:"entryId,omitempty"` Status *bool `json:"status,omitempty"` SourceType *int `json:"sourceType,omitempty"` SourceIds *[]string `json:"sourceIds,omitempty"` Urls *[]string `json:"urls,omitempty"` }
func (*Data) ToDownloadRateLimit ¶
Returns download rate limit in KBPS from omada SSID data response Returns -1 if no limit is set
func (*Data) ToUploadRateLimit ¶
Returns upload rate limit in KBPS from omada SSID data response Returns -1 if no limit is set
type NetworksResponse ¶
type NetworksResponse struct { Ssid *string `json:"ssid,omitempty"` RadioOn *bool `json:"radioOn,omitempty"` UploadLimit *int `json:"uploadLimit,omitempty"` DownloadLimit *int `json:"downloadLimit,omitempty"` UrlFilters *[]UrlFilter `json:"urlFilters,omitempty"` Updated *bool `json:"updated,omitempty"` ErrorMessage *string `json:"errorMessage,omitempty"` }
type NetworksSsidRequest ¶
type OmadaApi ¶
type OmadaApi interface { GetControllerId() (*OmadaResponse, error) Login(omadaControllerId *string) (*OmadaResponse, []*http.Cookie, error) GetSites(omadaControllerId *string, cookies []*http.Cookie, loginToken *string) (*OmadaResponse, error) GetWlans(omadaControllerId *string, cookies []*http.Cookie, loginToken *string, siteId *string) (*OmadaResponse, error) GetSsids(omadaControllerId *string, cookies []*http.Cookie, loginToken *string, siteId *string, wlanId *string) (*OmadaResponse, error) UpdateSsid(omadaControllerId *string, cookies []*http.Cookie, loginToken *string, siteId *string, wlanId *string, ssidUpdateData *Data) (*OmadaResponse, error) GetTimeRanges(omadaControllerId *string, cookies []*http.Cookie, loginToken *string, siteId *string) (*OmadaResponse, error) CreateTimeRange(omadaControllerId *string, cookies []*http.Cookie, loginToken *string, siteId *string, trData *Data) (*OmadaResponse, error) QueryUrlFilters(omadaControllerId *string, cookies []*http.Cookie, loginToken *string, siteId *string) (*OmadaResponse, error) CreateUrlFilter(omadaControllerId *string, cookies []*http.Cookie, loginToken *string, siteId *string, urlFilterData *Data) (*OmadaResponse, error) UpdateUrlFilter(omadaControllerId *string, cookies []*http.Cookie, loginToken *string, siteId *string, urlFilterData *Data) (*OmadaResponse, error) DeleteUrlFilter(omadaControllerId *string, cookies []*http.Cookie, loginToken *string, siteId *string, urlFilterId *string) (*OmadaResponse, error) }
func NewOmadaApi ¶
func NewOmadaApi(config *config.Configuration, httpClient apihttp.Client) OmadaApi
NewOmadaApi creates new omada api
type OmadaLoginData ¶
type OmadaResponse ¶
type OmadaResponse struct { ErrorCode int `json:"errorCode"` Msg *string `json:"msg,omitempty"` Result *Result `json:"result,omitempty"` }
nested within sbserver response
type OmadaTimeRangeData ¶
type PskSetting ¶
type PskSetting struct { SecurityKey *string `json:"securityKey,omitempty"` VersionPsk *int `json:"versionPsk,omitempty"` EncryptionPsk *int `json:"encryptionPsk,omitempty"` GikRekeyPskEnable *bool `json:"gikRekeyPskEnable,omitempty"` RekeyPskInterval *int `json:"rekeyPskInterval,omitempty"` IntervalPskType *int `json:"intervalPskType,omitempty"` }
type RateAndBeaconCtrl ¶
type RateLimit ¶
type RateLimit struct { DownLimitEnable *bool `json:"downLimitEnable,omitempty"` DownLimit *int `json:"downLimit,omitempty"` DownLimitType *int `json:"downLimitType,omitempty"` UpLimitEnable *bool `json:"upLimitEnable,omitempty"` UpLimit *int `json:"upLimit,omitempty"` UpLimitType *int `json:"upLimitType,omitempty"` RateLimitId *string `json:"rateLimitId,omitempty"` }
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
Repository to interact with networks data providers
func NewRepository ¶
func NewRepository(omadaApi OmadaApi) Repository
NewRepository creates new networks repository
func (*Repository) CreateTimeRange ¶
func (r *Repository) CreateTimeRange(omadaControllerId *string, cookies []*http.Cookie, loginToken *string, siteId *string, timeRangeData *Data) (*OmadaResponse, error)
func (*Repository) CreateUrlFilter ¶
func (r *Repository) CreateUrlFilter(omadaControllerId *string, cookies []*http.Cookie, loginToken *string, siteId *string, urlFilterData *Data) (*OmadaResponse, error)
func (*Repository) DeleteUrlFilter ¶
func (r *Repository) DeleteUrlFilter(omadaControllerId *string, cookies []*http.Cookie, loginToken *string, siteId *string, urlFilterId *string) (*OmadaResponse, error)
func (*Repository) GetControllerId ¶
func (r *Repository) GetControllerId() (*OmadaResponse, error)
func (*Repository) GetSites ¶
func (r *Repository) GetSites(omadaControllerId *string, cookies []*http.Cookie, loginToken *string) (*OmadaResponse, error)
func (*Repository) GetSsids ¶
func (r *Repository) GetSsids(omadaControllerId *string, cookies []*http.Cookie, loginToken *string, siteId *string, wlanId *string) (*OmadaResponse, error)
func (*Repository) GetTimeRanges ¶
func (r *Repository) GetTimeRanges(omadaControllerId *string, cookies []*http.Cookie, loginToken *string, siteId *string) (*OmadaResponse, error)
func (*Repository) GetWlans ¶
func (r *Repository) GetWlans(omadaControllerId *string, cookies []*http.Cookie, loginToken *string, siteId *string) (*OmadaResponse, error)
func (*Repository) Login ¶
func (r *Repository) Login(omadaControllerId *string) (*OmadaResponse, []*http.Cookie, error)
func (*Repository) QueryUrlFilters ¶
func (r *Repository) QueryUrlFilters(omadaControllerId *string, cookies []*http.Cookie, loginToken *string, siteId *string) (*OmadaResponse, error)
func (*Repository) UpdateSsid ¶
func (r *Repository) UpdateSsid(omadaControllerId *string, cookies []*http.Cookie, loginToken *string, siteId *string, wlanId *string, ssidUpdateData *Data) (*OmadaResponse, error)
func (*Repository) UpdateUrlFilter ¶
func (r *Repository) UpdateUrlFilter(omadaControllerId *string, cookies []*http.Cookie, loginToken *string, siteId *string, urlFilterData *Data) (*OmadaResponse, error)
type UrlFilterController ¶
type UrlFilterController interface { QueryUrlFilters(omadaControllerId *string, cookies []*http.Cookie, loginToken *string, siteId *string, ssidData *Data) (*[]UrlFilter, error) MaybeUpdateUrlFilters(omadaControllerId *string, cookies []*http.Cookie, loginToken *string, siteId *string, ssidData *Data, requestedFilters *[]UrlFilter) (*[]UrlFilter, *bool, error) }
Controller to operatate with URL filters
func NewUrlFilterController ¶
func NewUrlFilterController(r Repository) UrlFilterController
creates new URL filter controller
type WpaSetting ¶
type WpaSetting struct { VersionEnt *int `json:"versionEnt,omitempty"` EncryptionEnt *int `json:"encryptionEnt,omitempty"` GikRekeyEnable *bool `json:"gikRekeyEnable,omitempty"` RekeyInterval *bool `json:"rekeyInterval,omitempty"` IntervalType *int `json:"intervalType,omitempty"` RadiusProfileId *string `json:"radiusProfileId,omitempty"` }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.