TLD nameserver
A TLD nameserver maintains information for all the domain names that share a common domain extension, such as .com, .net, or whatever comes after the last dot in a URL.
Management of TLD nameservers is handled by the Internet Assigned Numbers Authority (IANA), which is a branch of ICANN. The IANA breaks up the TLD servers into two main groups:
Generic top-level domains: These are domains like .com, .org, .net, .edu, and .gov.
Country code top-level domains: These include any domains that are specific to a country or state. Examples include .uk, .us, .ru, and .jp.
A TLD nameserver maintains information for all the domain names that share a common domain extension, such as .com, .net, or whatever comes after the last dot in a URL.
Management of TLD nameservers is handled by the Internet Assigned Numbers Authority (IANA), which is a branch of ICANN. The IANA breaks up the TLD servers into two main groups:
Generic top-level domains: These are domains like .com, .org, .net, .edu, and .gov.
Country code top-level domains: These include any domains that are specific to a country or state. Examples include .uk, .us, .ru, and .jp.
new() is the only way to get a pointer to an unnamed integer or other basic type. You can write "p := new(int)" but you can't write "p := &int{0}". Other than that, it's a matter of preference.
What's the difference between '&' and 'new' on Golang? “ new ” creates an instance of an object in the heap and returns a pointer, “ & ” dereferences an object returning a pointer. Go allows escaping pointers (unlike C).
// Singleton implementation
type Singleton interface {
Add() int
}
type DB struct {
count int
}
func (s *DB) Add() int {
s.count++
return s.count
}
var Pointer *DB
func GetInstance() Singleton {
if Pointer == nil {
Pointer = new(DB)
}
return Pointer
}
func main() {
var single = GetInstance()
single.Add()
fmt.Println(single.Add())
fmt.Println(single)
}
To enable communication between goroutines, a simple approach is to use a locked queue (a “First-In-First-Out” data structure). Senders add items to the queue, and receivers take items from it. Interestingly, Go uses a similar concept for inter-goroutine communication, and they’ve named it “channels.”
Protocol Buffers are a language-neutral, platform-neutral extensible mechanism for serializing structured data.
It’s like JSON, except it’s smaller and faster, and it generates native language bindings. You define how you want your data to be structured once, then you can use special generated source code to easily write and read your structured data to and from a variety of data streams and using a variety of languages.
Protocol buffers are a combination of the definition language (created in .proto files), the code that the proto compiler generates to interface with data, language-specific runtime libraries, the serialization format for data that is written to a file (or sent across a network connection), and the serialized data.
It’s like JSON, except it’s smaller and faster, and it generates native language bindings. You define how you want your data to be structured once, then you can use special generated source code to easily write and read your structured data to and from a variety of data streams and using a variety of languages.
Protocol buffers are a combination of the definition language (created in .proto files), the code that the proto compiler generates to interface with data, language-specific runtime libraries, the serialization format for data that is written to a file (or sent across a network connection), and the serialized data.
OOP focuses on modeling programs around objects, which possess both data and methods.
FP concentrates on treating data as mathematical functions without altering their state.
FP concentrates on treating data as mathematical functions without altering their state.