When we talk about RTSP, it is actually not only the RTSP protocol itself, but we will actually inevitably talk about the following protocols.
RTP (Real-time Transport Protocol): the protocol really used to transmit audio-video, generally based on the UDP protocol, with special attention to the fact that it uses an even number of ports. RTCP (Real-time Control Protocol): sister protocol to RTP, which provides quality of service (QoS) feedback by periodically sending statistical information, it uses an odd number of ports and is RTP port + 1.
Three git flows and the version release model
The biggest difference between using Git, and other version control systems, is that Git is a distributed system, and in each copy of the repository, there is a full amount of code, so conflicts are common in collaboration. Let’s look at three Git development models.
git flow git flow is part of the first generation of the git development process. It is divided into two branches, develop and master, where all development is branched on develop and then periodically merged into master.
Kubernetes Resource Orchestration Series Part 1: Pod YAML
The Kubernetes Resource Orchestration Series, starting from the underlying Pod YAML, progressively explains related content, hoping to answer some of your questions about Kubernetes and give users a deeper understanding of cloud-native related technologies.
01 Pod Overall Structure The overall structure of Pod YAML can be initially divided into Resource, Object, Spec and Status. This article will focus on each of these four parts.
Resource: Defines the type and version of the resource, as a mandatory attribute to get the resource from the Rest API.
How WebPush works
At this year’s developer conference, Apple announced that Safari will support the WebPush standard. The first support will be for the mac platform, which will be released this fall. Then it will be available for iOS in the first half of next year. By then, all major browsers will support WebPush features. This is a milestone for the Web! The Internet market is now desperately trying to promote mobile applications. One of the main reasons is that the retention rate of Web platform is very low, and the main reason for the low retention rate is the lack of push support.
Golang High Performance Programming Manual
Robust, readable and efficient code is a common goal for all of us developers. In this article, we will combine the features of Go language to give advice on common data structures, memory management and concurrency for writing more efficient code. Without further ado, let’s learn the techniques of Go high-performance programming together. 1. Common Data Structures 1.1 Don’t abuse reflection The standard library reflect provides the Go language with
Cross-language calls in Golang
There are specific scenarios where we are troubled by the fact that
the performance of the current development language is still insufficient, such as video processing (in the field of live streaming), machine learning, and games. there are some excellent C/C++ libraries that cannot be reimplemented in the current development language for a while (FFmpeg, OpenCV, Protobuf, ZeroMQ, and a whole lot more). In general, we will tend to use several ways to solve this.
Golang Heap Profiling
Studying the performance of a program is important for every engineer, and I can even say this: It is a necessary skill for an engineer.
Golang’s performance analysis tool, pprof, supports the following kinds of analysis.
heap: a sampling of all living objects in current memory (almost a must for languages with GC), which can be used to analyze memory problems. profile: as opposed to heap, a sampling of the CPU, which can be used to analyze the time-consuming bottleneck of the program.
Unicode and UTF-8 in Golang
As we know, inside the computer, in order to convert binary data to the display, it is necessary to encode, that is, the displayable characters correspond to the binary data one by one, such as ASCII code, which is a Byte of data to represent the English characters plus some English symbols.
As for Chinese, we obviously can not use just one Byte to represent, we need to use a larger space.
Golang in Docker
Golang as a static language must be compiled before running, while dynamic languages like Python can be run directly in an interpreter environment, so their best practices for docker deployment will be slightly different.
Dockerfile for Golang Here I’ll start by giving the Dockerfile for Goalng directly.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 FROM golang:alpine AS builder # Set necessary environmet variables needed for our image ENV GO111MODULE=on \ GOPROXY=https://goproxy.
Embrace Atomic CSS-in-JS
Nowadays, Atomic CSS is gaining more and more attention. Compared to the traditional CSS writing method where each component has one CSS class. With Atomic CSS, each CSS class uniquely corresponds to a separate CSS rule. As the number of components grows, more and more CSS rules can be reused. The final CSS product is much smaller, allowing for a quantum leap in page load speed. History of CSS authoring
Scanner and Valuer interfaces in the Golang database module
The Scanner / Valuer interface provides the ability to convert custom types and database types to each other.
Problems encountered in reality When developing applications, some of the fields in the tables are customized, for example.
1 2 type Day time.Time // Time in days type LocaleTime time.Time // Time of local formatting Why do I need to redefine these types?
My reason here is to output normalized values when providing the JSON interface downstream.
Managing Tekton components with Tektoncd Operator
Tektoncd Operator is a Kubernetes extension for installing, upgrading and managing TektonCD Pipelines, Dashboard, Triggers, etc. on a Kubernetes cluster. We just need to write the yaml for each component to manage Tekton components directly.
CRD Description TektonConfig Configure the Tekton components to be installed and managed. TektonPipeline Configure the installation to manage Tekton Pipeline components. TektonTrigger Configure the installation to manage the Tekton Trigger component. TektonDashboard Configure the installation to manage Tekton Dashboard components.
Cloud Native Declarative Database Structure Migration Tool - SchemaHero
SchemaHero is an open source declarative database schema migration cloud-native tool that converts schema definitions into migration scripts that can be applied in any environment. Written as a CLI tool and Kubernetes Operator, SchemaHero eliminates the task of creating and managing sequential migration scripts that are compatible with all environments in which applications are running.
Many database schema management tools create an imperative interface that requires the developer to know the current state of the schema and the relevant commands to migrate the current schema (and associated data) to the new schema.
FAQ about Go plugin and solutions
I have encountered a lot of problems in designing and implementing extension development products based on the Go native plug-in mechanism, and since there is very little relevant information in this area, I would like to take this opportunity to make a very rough summary, and hope that it will help you.
This article only say the problem and the solution, do not read the code.
Some background knowledge 2.1 Runtime In general, in the field of computer programming languages, the concept of “runtime” is associated with languages that require the use of a vm.
Implementing bidirectional data exchange between kernel and user states of eBPF programs using Golang
In the previous two articles, both “Developing eBPF programs in C” and “Developing eBPF programs in Go” are hello world level, which may be useful, but not very practical.
Generally speaking, a practical eBPF program has data exchange between its kernel state part and user state part, and with this data exchange, eBPF can play a more powerful role. And to make an eBPF program more practical, eBPF MAP is the mechanism that cannot be bypassed.
Get OS information using gopsutil
What do you do if you need to get the usage of your host’s hard disk, CPU, memory, processes, etc. in Golang? A simple idea would be to run some commands like ps, cd, top through os/exec and then parse the results of those commands.
Of course, based on the Linux idea that everything is a file, a more straightforward approach would be to read the contents of the relevant files, such as those in the /proc directory.
PostgreSQL 15 improvements to UNIQUE and NULL
Summarize this improvement in the following sentence.
Support for unique constraints and indexing treats null values as identical. Previously, null values were indexed as distinct values. Now you can create constraints that treat null values as identical by using unique nulls not distinct. Two unique styles Create the example table.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 CREATE TABLE null_old_style ( id BIGINT GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY, val1 TEXT NOT NULL, val2 TEXT NULL, CONSTRAINT uq_val1_val2 UNIQUE (val1, val2) ); CREATE TABLE null_new_style ( id BIGINT GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY, val1 TEXT NOT NULL, val2 TEXT NULL, CONSTRAINT uq_val1_val2_new UNIQUE NULLS NOT DISTINCT (val1, val2) ); Changes in supported data In postgresql 14 or earlier, the uniqueness constraint treats null as not the same as null.
Exposing Go program runtime metrics with expvar
Obtaining the application’s operational metrics gives us a better understanding of its actual status. By connecting these metrics to monitoring systems such as prometheus, zabbix, etc., the application can be continuously checked and any abnormalities can be alerted and handled in a timely manner.
Pull and Push There are two ways to interface with monitoring systems, one is Pull and the other is Push.
In the case of Prometheus, for example, the application exposes an HTTP interface for Prometheus to periodically grab metrics through, which is called Pull, while Push is when the application actively pushes metrics to PushGateway.
serde custom serialization
serde is pretty much the most commonly used serialization and deserialization library in the Rust ecosystem today.
Golang Implementation As a Golang programmer, it’s important to compare.
The official Golang library directly implements serialization and deserialization of json.
For both serialization and deserialization, Go uses a simple interface called interface.
1 2 3 4 5 6 7 8 9 // https://pkg.go.dev/encoding/json#Marshaler type Marshaler interface { MarshalJSON() ([]byte, error) } // https://pkg.
VXLAN Protocol for Cloud-Native Virtual Networks
The first time I got to know VXLAN was when I looked at a network plugin called flannel used in k8s that has a VXLAN mode, which implements an Overlay Network that connects all containers together. So in this article, let’s take a look at how VXLAN connects the networks between different containers.
Overview Before we look at VXLAN, let’s take a look at its predecessor, VLAN, whose full name is Virtual Local Area Network, a layer 2 (data link layer) network used to partition broadcast domains.