Documentation ¶
Overview ¶
Code generated for package edgecli by go-bindata DO NOT EDIT. (@generated) sources: config/dev.yml config/prod.yml
Index ¶
- Constants
- Variables
- func Asset(name string) ([]byte, error)
- func AssetDir(name string) ([]string, error)
- func AssetInfo(name string) (os.FileInfo, error)
- func AssetNames() []string
- func GenerateInstanceId() string
- func GenerateRandomMac() (string, error)
- func HandleCall(req *http.Request) (interface{}, error)
- func HandleFilePrefix(authFile string) (string, error)
- func HandleFileStatus(file string) error
- func LoadClientConfig()
- func MustAsset(name string) []byte
- func NewSuccessResponse(message string, data ...interface{}) error
- func RestoreAsset(dir, name string) error
- func RestoreAssets(dir, name string) error
- func RevealHardwareUUID() (string, error)
- func RevealHostName() string
- func RevealOS() string
- type AuthMethod
- type AuthOption
- type AuthResp
- type AuthService
- type AuthTokenResponse
- type CIDR
- type DeviceNet
- type DeviceResponse
- type DeviceSubnetRouteResponse
- type DeviceVirtualNetworkResponse
- type ErrorResponse
- type HttpOption
- type IdentityResponse
- type InvitationResponse
- type JoinOption
- type JoinVirtualNetworkResponse
- type ProfileResponse
- type RefreshTokenOption
- type RegisterDeviceSubnetRouteRequest
- type RegisterOption
- type RegisterService
- type ResetPasswordResponse
- type ScanOption
- type ScanResult
- type ScanService
- type SecurityKeyResponse
- type ServerResponse
- type StartOption
- type StartService
- type SubnetRouteDeviceRequest
- type SubnetRouteDeviceResponse
- type SuccessResponse
- type UploadOption
- type VirtualNetwork
- type VirtualNetworkDeviceResponse
- type VirtualNetworkResponse
- type VirtualNetworkService
- type VirtualNetworkUserResponse
Constants ¶
const ( RestJoinOmniEdge = "client-join-url" GraphqlEndpoint = "graphql-endpoint" )
const ( ContentType = "Content-Type" ContentJson = "application/json" Authorization = "authorization" )
const (
FailGetMacAddress = "fail to get mac address"
)
Variables ¶
var ConfigV = viper.New()
var Env string
Functions ¶
func Asset ¶
Asset loads and returns the asset for the given name. It returns an error if the asset could not be found or could not be loaded.
func AssetDir ¶
AssetDir returns the file names below a certain directory embedded in the file by go-bindata. For example if you run go-bindata on data/... and data contains the following hierarchy:
data/ foo.txt img/ a.png b.png
then AssetDir("data") would return []string{"foo.txt", "img"} AssetDir("data/img") would return []string{"a.png", "b.png"} AssetDir("foo.txt") and AssetDir("notexist") would return an error AssetDir("") will return []string{"data"}.
func AssetInfo ¶
AssetInfo loads and returns the asset info for the given name. It returns an error if the asset could not be found or could not be loaded.
func GenerateInstanceId ¶
func GenerateInstanceId() string
func GenerateRandomMac ¶
func HandleCall ¶
func HandleFilePrefix ¶
HandleFilePrefix /** parse user input of auth file path
func HandleFileStatus ¶
func LoadClientConfig ¶
func LoadClientConfig()
func MustAsset ¶
MustAsset is like Asset but panics when Asset would return an error. It simplifies safe initialization of global variables.
func NewSuccessResponse ¶
func RestoreAsset ¶
RestoreAsset restores an asset under the given directory
func RestoreAssets ¶
RestoreAssets restores an asset under the given directory recursively
func RevealHardwareUUID ¶
func RevealHostName ¶
func RevealHostName() string
Types ¶
type AuthMethod ¶
type AuthMethod string
const ( LoginBySecretKey AuthMethod = "LoginBySecretKey" LoginByPassword AuthMethod = "LoginByPassword" )
type AuthOption ¶
type AuthOption struct { Username string Password string SecretKey string AuthMethod AuthMethod }
type AuthService ¶
type AuthService struct {
HttpOption
}
func (*AuthService) Login ¶
func (s *AuthService) Login(opt *AuthOption) (*AuthResp, error)
func (*AuthService) Refresh ¶
func (s *AuthService) Refresh(opt *RefreshTokenOption) (*AuthResp, error)
type AuthTokenResponse ¶
type AuthTokenResponse struct {
Token string `json:"token"`
}
type DeviceNet ¶
type DeviceResponse ¶
type DeviceResponse struct { ID string `json:"id"` Name string `json:"name"` OS string `json:"os"` VirtualNetworks []*DeviceVirtualNetworkResponse `json:"virtual_networks,omitempty"` Subnets []*DeviceSubnetRouteResponse `json:"subnets,omitempty"` }
type DeviceSubnetRouteResponse ¶
type DeviceSubnetRouteResponse struct { ID string `json:"id"` IP string `json:"ip"` MacAddr string `json:"mac_addr"` SubnetMask string `json:"subnet_mask"` Devices []*SubnetRouteDeviceResponse `json:"devices"` }
type ErrorResponse ¶
type ErrorResponse struct { Code int `json:"-"` Message string `json:"message"` Errors interface{} `json:"errors"` }
func (ErrorResponse) Error ¶
func (err ErrorResponse) Error() string
type HttpOption ¶
type IdentityResponse ¶
type InvitationResponse ¶
type JoinOption ¶
type JoinVirtualNetworkResponse ¶
type JoinVirtualNetworkResponse struct { CommunityName string `json:"community_name"` SecretKey string `json:"secret_key"` VirtualIP string `json:"virtual_ip"` SubnetMask string `json:"subnet_mask"` Server *ServerResponse `json:"server"` }
type ProfileResponse ¶
type ProfileResponse struct { ID string `json:"id"` Name string `json:"name"` Email string `json:"email"` Picture string `json:"picture"` Identities []*IdentityResponse `json:"identities"` }
type RefreshTokenOption ¶
type RefreshTokenOption struct {
RefreshToken string
}
type RegisterDeviceSubnetRouteRequest ¶
type RegisterDeviceSubnetRouteRequest struct { IP string `json:"ip" validate:"required,ipv4"` MacAddr string `json:"mac_addr" validate:"required,mac"` SubnetMask string `json:"subnet_mask" validate:"required,ipv4"` Devices []*SubnetRouteDeviceRequest `json:"devices"` }
type RegisterOption ¶
type RegisterService ¶
type RegisterService struct {
HttpOption
}
func (*RegisterService) Register ¶
func (s *RegisterService) Register(opt *RegisterOption) (*DeviceResponse, error)
type ResetPasswordResponse ¶
type ResetPasswordResponse struct {
Email string `json:"email"`
}
type ScanOption ¶
type ScanResult ¶
type ScanService ¶
type ScanService struct {
ScanOption
}
func (*ScanService) Scan ¶
func (s *ScanService) Scan(option *ScanOption) (*[]ScanResult, error)
type SecurityKeyResponse ¶
type ServerResponse ¶
type StartOption ¶
type StartService ¶
type StartService struct {
StartOption
}
func (*StartService) Start ¶
func (s *StartService) Start() error
type SuccessResponse ¶
type SuccessResponse struct { Code int `json:"-"` Message string `json:"message"` Data interface{} `json:"data"` }
func (SuccessResponse) Error ¶
func (err SuccessResponse) Error() string
type UploadOption ¶
type UploadOption struct { IP string MacAddress string SubnetMask string DeviceId string ScanResults []*ScanResult }
type VirtualNetwork ¶
type VirtualNetworkResponse ¶
type VirtualNetworkResponse struct { ID string `json:"id"` Name string `json:"name"` IPRange string `json:"ip_range"` Role int `json:"role"` Server *ServerResponse `json:"server,omitempty"` Devices []*VirtualNetworkDeviceResponse `json:"devices,omitempty"` Users []*VirtualNetworkUserResponse `json:"users,omitempty"` }
type VirtualNetworkService ¶
type VirtualNetworkService struct {
HttpOption
}
func (*VirtualNetworkService) Join ¶
func (s *VirtualNetworkService) Join(opt *JoinOption) (*JoinVirtualNetworkResponse, error)
func (*VirtualNetworkService) List ¶
func (s *VirtualNetworkService) List() ([]VirtualNetworkResponse, error)
func (*VirtualNetworkService) Upload ¶
func (s *VirtualNetworkService) Upload(opt *UploadOption) error