Service client overview

Preface

It has been more than a year since I came into contact with the new programming language go at the end of 2019 and at the beginning of 2021.

For most of 2020, I have been busy with technological transformation, and I have become restless. If your own accumulation is not enough, you will naturally run into obstacles everywhere.

In the new year of 2021, I will reopen this blog site.

I hope to write more about my learning experience, record more learning methods, make more friends, and grow more.

Starting from this article, I will introduce the development process of a simple small project.

From the early stage of combing project requirements and finding reference projects with relevant technical difficulties, to solutions to some problems during the development process.

Slowly adjust the structure of the project until the project is perfectly presented within the scope of your own technical understanding.

***Note: The perfect presentation here does not mean that there are really no problems with this project. I just want to make this project the best it can be based on my personal technical experience. ***

New requirements

Currently there is such a requirement:

  • Deploy a client application to more than 100 devices in a windows-based system environment.
  • The client will perform some tasks, such as collecting device CPU, memory and other operating indicators, or running a web application.
  • It is required that this client must run as a service on the target device with administrator privileges.
  • The client needs to have the ability to automatically update. Each update requires manual updating by operation and maintenance personnel.
  • It’s going to be a huge amount of work. If updates are frequent, operation and maintenance personnel may crash.

Decompose requirements

The breakdown of the above requirements is roughly divided into the following parts:

  • Implement a program and register it as a windows system service.
  • Implement a backend to manage program versions and provide interfaces for checking program versions and downloading programs.
  • Monitor in real time whether the program is updated, and update the program if there is a new version.