api

package
v0.0.0-...-8178683 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Github = &githubAPI{
		&api{
			baseURL: config.Cfg.GithubServerURL,
		},
	}
	Sb = &sbAPI{
		&api{
			baseURL: config.Cfg.SbServerURL,
		},
	}
)

Functions

func NewGithubApi

func NewGithubApi(url string) *githubAPI

func NewSbApi

func NewSbApi(url string) *sbAPI

Types

type API

type API interface {
	GetRequest(path string, timeout int) ([]byte, error)
	PostRequest(path string, contentType string, reqBody interface{}, timeout int) ([]byte, error)
	PutRequest(path string, contentType string, reqBody interface{}, timeout int) ([]byte, error)
	DeleteRequest(path string, timeout int) ([]byte, error)
	PostRequestAddOption(path string, contentType string, option string, reqBody interface{}, timeout int) ([]byte, error)
	PostFileRequest(path string, fileData []byte, timeout int) error
}

type DeviceInfo

type DeviceInfo struct {
	Name string `json:"name"`
	If   string `json:"if"`
}

type GithubApiInterface

type GithubApiInterface interface {
	API
	PostFilesForBytes(byteMap map[string][]byte) error
	UpdateFilesForBytes(byteMap map[string][]byte) error
	InitializeFilesForBytes(byteMap map[string][]byte) error
	GetDeviceConfigs([]string) (map[string]orderedmap.OrderedmapInterfaces, error)
	GetServices(services []string) (map[string]orderedmap.OrderedmapInterfaces, error)
	GetServiceRefs([]string) (map[string]map[string]pathmap.PathMapInterface, error)
	GetDevices(services []string) (map[string]orderedmap.OrderedmapInterfaces, error)
	GetDeviceRefs([]string) (map[string]map[string]pathmap.PathMapInterface, error)
	DeleteServices(serviceNames []string) error
	MakePathForDeviceRef(string) string
	MakePathForDeviceActual(string) string
	MakePathForDeviceSet(string) string
	MakePathForServiceInput(string) string
	MakePathForServiceOutput(string) string
}

type ResGetDevices

type ResGetDevices struct {
	Devices []DeviceInfo `json:"devices"`
}

type SbApiInterface

type SbApiInterface interface {
	API
	GetDevice(string) (orderedmap.OrderedmapInterfaces, error)
	SetDevice(string, interface{}) ([]byte, error)
	GetDeviceInfos() (map[string]string, error)
}

Jump to

Keyboard shortcuts

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