Versions in this module Expand all Collapse all v0 v0.9.0 Sep 28, 2023 Changes in this version + const DeviceKind + const ServiceKind + func HttpCapabilities(c echo.Context, path string) error + func HttpGet(c echo.Context, rootpath string) error + func HttpSet(c echo.Context, ctx context.Context, gogit *gogit.Git, scfg *ServeCfg) error + func RunServeHttp(ctx context.Context, cfg *ServeCfg) error + type HttpGetBody struct + Paths []string + type HttpSetBody struct + Path string + Value map[string]interface{} + type HttpSetRes struct + After map[string]interface{} + Before map[string]interface{} type ServeCfg + HttpAddr string v0.0.0 Jan 20, 2023 Changes in this version + const KeyDeviceName + const KeyServiceKind + const NodeDevice + const NodeService + const PathTypeDevice + const PathTypeService + var UpdateCheckDuration = 5 * time.Second + func CheckGitFileIsStagedOrUnmodified(path string, st extgogit.FileStatus) error + func CheckGitFileStatus(path string, st extgogit.FileStatus) error + func CheckGitIsStagedOrUnmodified(stmap extgogit.Status) error + func CheckGitStatus(stmap extgogit.Status) error + func CollectPartialDeviceConfig(dir, device string) ([]string, error) + func ConvertMapKeyToString(path string, in io.Reader, out io.Writer) error + func GetGNMIServiceVersion() (string, error) + func MakeCommitMessage(stmap extgogit.Status) string + func MakeSyncCommitMessage(stmap git.Status) string + func RunCueGet(ctx context.Context, cfg *CueGetCfg) error + func RunCueGetImpl(ctx context.Context, path string, getter CueGetter) error + func RunDeviceAggregate(ctx context.Context, cfg *DeviceAggregateCfg) error + func RunDeviceComposite(ctx context.Context, cfg *DeviceCompositeCfg) error + func RunGitCommit(ctx context.Context, cfg *GitCommitCfg) error + func RunServe(ctx context.Context, cfg *ServeCfg) error + func RunServiceApply(ctx context.Context, cfg *ServiceApplyCfg) error + func RunServiceCompile(ctx context.Context, cfg *ServiceCompileCfg) error + func SetupGitRepoWithRemote(t *testing.T, remote string) (*git.Repository, string, string) + func WithWriter(parent context.Context, w io.Writer) context.Context + func WriterFromContext(ctx context.Context) io.Writer + type CueGetCfg struct + FilePath string + func (c *CueGetCfg) Mask() *CueGetCfg + func (c *CueGetCfg) Validate() error + type CueGetFunc func(modPath, outDir string) error + func (fn CueGetFunc) Exec(modPath, outDir string) error + type CueGetter interface + Exec func(modPath, outDir string) error + type DeviceAggregateCfg struct + Addr string + Insecure bool + NoTLS bool + TLSCACrtPath string + TLSCrtPath string + TLSKeyPath string + func (c *DeviceAggregateCfg) Mask() *DeviceAggregateCfg + func (c *DeviceAggregateCfg) TLSServerConfig() *credentials.TLSServerConfig + func (c *DeviceAggregateCfg) Validate() error + type DeviceAggregateServer struct + func NewDeviceAggregateServer(cfg *DeviceAggregateCfg) *DeviceAggregateServer + func (s *DeviceAggregateServer) GitPushDeviceConfig(ctx context.Context) error + func (s *DeviceAggregateServer) HandleFunc(w http.ResponseWriter, r *http.Request) + func (s *DeviceAggregateServer) Run(ctx context.Context) + func (s *DeviceAggregateServer) SaveConfig(ctx context.Context, r *SaveConfigRequest) error + type DeviceCompositeCfg struct + Device string + func (c *DeviceCompositeCfg) Mask() *DeviceCompositeCfg + func (c *DeviceCompositeCfg) Validate() error + type DeviceCompositePlan struct + func NewDeviceCompositePlan(stmap extgogit.Status, root string) *DeviceCompositePlan + func (p *DeviceCompositePlan) Do(ctx context.Context, compositeFunc DeviceFunc) error + func (p *DeviceCompositePlan) IsEmpty() bool + type DeviceFunc func(ctx context.Context, sp kuesta.DevicePath) error + type DevicePathReq struct + func (DevicePathReq) Type() PathType + func (s DevicePathReq) Path() *kuesta.DevicePath + func (s DevicePathReq) String() string + type ErrConfigValue struct + func (e *ErrConfigValue) Error() string + type GitCommitCfg struct + func (c *GitCommitCfg) Mask() *GitCommitCfg + func (c *GitCommitCfg) Validate() error + type GnmiPathConverter struct + func NewGnmiPathConverter(cfg *ServeCfg) *GnmiPathConverter + func (c *GnmiPathConverter) Convert(prefix, path *gnmi.Path) (PathReq, error) + type GnmiRequestHandler interface + Capabilities func(ctx context.Context, req *pb.CapabilityRequest) (*pb.CapabilityResponse, error) + Delete func(ctx context.Context, prefix, path *pb.Path) (*pb.UpdateResult, error) + Get func(ctx context.Context, prefix, path *pb.Path) (*pb.Notification, error) + Replace func(ctx context.Context, prefix, path *pb.Path, val *pb.TypedValue) (*pb.UpdateResult, error) + Update func(ctx context.Context, prefix, path *pb.Path, val *pb.TypedValue) (*pb.UpdateResult, error) + type NorthboundServer struct + func NewNorthboundServer(cfg *ServeCfg) (*NorthboundServer, error) + func NewNorthboundServerWithGit(cfg *ServeCfg, cGit, sGit *gogit.Git) *NorthboundServer + func (s *NorthboundServer) Capabilities(ctx context.Context, req *pb.CapabilityRequest) (*pb.CapabilityResponse, error) + func (s *NorthboundServer) Get(ctx context.Context, req *pb.GetRequest) (*pb.GetResponse, error) + func (s *NorthboundServer) RunConfigSyncLoop(ctx context.Context, dur time.Duration) + func (s *NorthboundServer) RunStatusSyncLoop(ctx context.Context, dur time.Duration) + func (s *NorthboundServer) Set(ctx context.Context, req *pb.SetRequest) (*pb.SetResponse, error) + type NorthboundServerImpl struct + func NewNorthboundServerImpl(cfg *ServeCfg) *NorthboundServerImpl + func (s *NorthboundServerImpl) Capabilities(ctx context.Context, req *pb.CapabilityRequest) (*pb.CapabilityResponse, error) + func (s *NorthboundServerImpl) Delete(ctx context.Context, prefix, path *pb.Path) (*pb.UpdateResult, error) + func (s *NorthboundServerImpl) Get(ctx context.Context, prefix, path *pb.Path) (*pb.Notification, error) + func (s *NorthboundServerImpl) Replace(ctx context.Context, prefix, path *pb.Path, val *pb.TypedValue) (*pb.UpdateResult, error) + func (s *NorthboundServerImpl) Update(ctx context.Context, prefix, path *pb.Path, val *pb.TypedValue) (*pb.UpdateResult, error) + type PathReq interface + String func() string + Type func() PathType + type PathType string + type RootCfg struct + ConfigRepoUrl string + ConfigRootPath string + Devel bool + GitEmail string + GitRemote string + GitToken string + GitTrunk string + GitUser string + PushToMain bool + StatusRepoUrl string + StatusRootPath string + Verbose uint8 + func (c *RootCfg) ConfigGitOptions() *gogit.GitOptions + func (c *RootCfg) Mask() *RootCfg + func (c *RootCfg) StatusGitOptions() *gogit.GitOptions + func (c *RootCfg) Validate() error + type SaveConfigRequest struct + Config *string + Device string + func DecodeSaveConfigRequest(r io.Reader) (*SaveConfigRequest, error) + func (r *SaveConfigRequest) Validate() error + type ServeCfg struct + Addr string + Insecure bool + NoTLS bool + PersistGitState bool + SyncPeriod int + TLSCACrtPath string + TLSCrtPath string + TLSKeyPath string + func (c *ServeCfg) Mask() *ServeCfg + func (c *ServeCfg) TLSServerConfig() *credentials.TLSServerConfig + func (c *ServeCfg) Validate() error + type ServiceApplyCfg struct + func (c *ServiceApplyCfg) Mask() *ServiceApplyCfg + func (c *ServiceApplyCfg) Validate() error + type ServiceCompileCfg struct + Keys []string + Service string + func (c *ServiceCompileCfg) Mask() *ServiceCompileCfg + func (c *ServiceCompileCfg) Validate() error + type ServiceCompilePlan struct + func NewServiceCompilePlan(stmap extgogit.Status, root string) *ServiceCompilePlan + func (p *ServiceCompilePlan) Do(ctx context.Context, deleteFunc ServiceFunc, updateFunc ServiceFunc) error + func (p *ServiceCompilePlan) IsEmpty() bool + type ServiceFunc func(ctx context.Context, sp kuesta.ServicePath) error + type ServicePathReq struct + func (ServicePathReq) Type() PathType + func (s *ServicePathReq) Keys() map[string]string + func (s *ServicePathReq) Path() *kuesta.ServicePath + func (s ServicePathReq) String() string + type VisitFunc func(n ast.Node) ast.Visitor + func (v VisitFunc) Visit(n ast.Node) ast.Visitor