Documentation
¶
Index ¶
- func DeletePlaybookDB(db *bolt.DB, pb *playbook.Playbook) error
- func GetAllPlaybooksFromDB(db *bolt.DB) map[string]*playbook.Playbook
- func ServerMain()
- func UpdatePlaybookDB(db *bolt.DB, pb *playbook.Playbook) error
- type AutoUpdater
- type AutoVPNServer
- func (s *AutoVPNServer) ExecuteTask(in *pb.ExecuteRequest, ss pb.AutoVPN_ExecuteTaskServer) error
- func (s *AutoVPNServer) StepApplyDNS(updates chan *executor.ExecutorUpdate, ctx context.Context) context.Context
- func (s *AutoVPNServer) StepApplyLockAdd(updates chan *executor.ExecutorUpdate, ctx context.Context) context.Context
- func (s *AutoVPNServer) StepApplyRoutes(updates chan *executor.ExecutorUpdate, ctx context.Context) context.Context
- func (s *AutoVPNServer) StepFetchIPs(updates chan *executor.ExecutorUpdate, ctx context.Context) context.Context
- func (s *AutoVPNServer) StepFinalizePlaybook(updates chan *executor.ExecutorUpdate, ctx context.Context) context.Context
- func (s *AutoVPNServer) StepList(updates chan *executor.ExecutorUpdate, ctx context.Context) context.Context
- func (s *AutoVPNServer) StepSwapPlaybooks(updates chan *executor.ExecutorUpdate, ctx context.Context) context.Context
- func (s *AutoVPNServer) StepUndoDNS(updates chan *executor.ExecutorUpdate, ctx context.Context) context.Context
- func (*AutoVPNServer) StepUndoRoutes(updates chan *executor.ExecutorUpdate, ctx context.Context) context.Context
- func (s *AutoVPNServer) StepUpdatePlaybook(updates chan *executor.ExecutorUpdate, ctx context.Context) context.Context
- func (s *AutoVPNServer) UpdateUpdaterTable()
- func (s *AutoVPNServer) UpdaterLoop()
- type TaskBuilder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ServerMain ¶
func ServerMain()
Types ¶
type AutoUpdater ¶
type AutoUpdater struct {
// contains filtered or unexported fields
}
More like AutoSlow, because of how unscalable and unoptimized it is. Needs redesign and refactor like client code. Someday i'll have the time for that ~sigh~
func NewAutoUpdater ¶
func NewAutoUpdater(server *AutoVPNServer) *AutoUpdater
func (*AutoUpdater) DelEntry ¶
func (u *AutoUpdater) DelEntry(name string)
func (*AutoUpdater) GetEntries ¶
func (u *AutoUpdater) GetEntries() map[string]int
func (*AutoUpdater) Tick ¶
func (u *AutoUpdater) Tick()
func (*AutoUpdater) UpdateEntry ¶
func (u *AutoUpdater) UpdateEntry(name string, interval int)
type AutoVPNServer ¶
type AutoVPNServer struct { pb.UnimplementedAutoVPNServer // contains filtered or unexported fields }
func (*AutoVPNServer) ExecuteTask ¶
func (s *AutoVPNServer) ExecuteTask(in *pb.ExecuteRequest, ss pb.AutoVPN_ExecuteTaskServer) error
func (*AutoVPNServer) StepApplyDNS ¶
func (s *AutoVPNServer) StepApplyDNS(updates chan *executor.ExecutorUpdate, ctx context.Context) context.Context
Put these DNS records onto our dns cache server or whatever. Wants in context: "playbook", "dnsrecords"
func (*AutoVPNServer) StepApplyLockAdd ¶
func (s *AutoVPNServer) StepApplyLockAdd(updates chan *executor.ExecutorUpdate, ctx context.Context) context.Context
Lock newly parsed playbook and add to db. Wants in context: playbook
func (*AutoVPNServer) StepApplyRoutes ¶
func (s *AutoVPNServer) StepApplyRoutes(updates chan *executor.ExecutorUpdate, ctx context.Context) context.Context
Put these routes on our router. Wants in context: playbook, dnsrecords
func (*AutoVPNServer) StepFetchIPs ¶
func (s *AutoVPNServer) StepFetchIPs(updates chan *executor.ExecutorUpdate, ctx context.Context) context.Context
Run DOH resolver to gather ips to route. Wants in context: "playbook"
func (*AutoVPNServer) StepFinalizePlaybook ¶
func (s *AutoVPNServer) StepFinalizePlaybook(updates chan *executor.ExecutorUpdate, ctx context.Context) context.Context
Set out playbook as installed and unlock. Wants in context: "playbook"
func (*AutoVPNServer) StepList ¶
func (s *AutoVPNServer) StepList(updates chan *executor.ExecutorUpdate, ctx context.Context) context.Context
List our playbooks to the user
func (*AutoVPNServer) StepSwapPlaybooks ¶
func (s *AutoVPNServer) StepSwapPlaybooks(updates chan *executor.ExecutorUpdate, ctx context.Context) context.Context
Swap new playbook with retrieved old. For updating existing playbooks with new revisions. Wants in context: old_playbook, playbook
func (*AutoVPNServer) StepUndoDNS ¶
func (s *AutoVPNServer) StepUndoDNS(updates chan *executor.ExecutorUpdate, ctx context.Context) context.Context
Remove these DNS records from our dns cache server or whatever. Wants in context: "playbook"
func (*AutoVPNServer) StepUndoRoutes ¶
func (*AutoVPNServer) StepUndoRoutes(updates chan *executor.ExecutorUpdate, ctx context.Context) context.Context
Remove these routes records from our router. Wants in context: "playbook"
func (*AutoVPNServer) StepUpdatePlaybook ¶
func (s *AutoVPNServer) StepUpdatePlaybook(updates chan *executor.ExecutorUpdate, ctx context.Context) context.Context
Update current playbook in bbolt db. Wants in context: playbook
func (*AutoVPNServer) UpdateUpdaterTable ¶
func (s *AutoVPNServer) UpdateUpdaterTable()
func (*AutoVPNServer) UpdaterLoop ¶
func (s *AutoVPNServer) UpdaterLoop()
type TaskBuilder ¶
type TaskBuilder struct {
// contains filtered or unexported fields
}
Builds a task, by creating an executor with a specific set of steps and a prepared context.
func NewTaskBuilder ¶
func NewTaskBuilder(srv *AutoVPNServer) *TaskBuilder
func (*TaskBuilder) Apply ¶
func (tb *TaskBuilder) Apply(playbk_yaml string) error
func (*TaskBuilder) Build ¶
func (tb *TaskBuilder) Build() *executor.Executor
func (*TaskBuilder) List ¶
func (tb *TaskBuilder) List() error
func (*TaskBuilder) Undo ¶
func (tb *TaskBuilder) Undo(pbook_name string) error