Limit search to available items
Record 50 of 235
Previous Record Next Record
Book Cover
E-book
Author Tsoukalos, Mihalis, author

Title Go systems programming : master Linux and Unix system level programming with Go / Mihalis Tsoukalos
Published Birmingham, UK : Packt Publishing, 2017

Copies

Description 1 online resource (1 volume) : illustrations
Contents Cover -- Title Page -- Copyright -- Credits -- About the Author -- About the Reviewer -- www.PacktPub.com -- Customer Feedback -- Table of Contents -- Preface -- Chapter 1: Getting Started with Go and Unix Systems Programming -- The structure of the book -- What is systems programming? -- Learning systems programming -- About Go -- Getting ready for Go -- Two useful Go tools -- Advantages and disadvantages of Go -- The various states of a Unix process -- Exercises -- Summary -- Chapter 2: Writing Programs in Go -- Compiling Go code -- Checking the size of the executable file -- Go environment variables -- Using command-line arguments -- Finding the sum of the command-line arguments -- User input and output -- Getting user input -- Printing output -- Go functions -- Naming the return values of a Go function -- Anonymous functions -- Illustrating Go functions -- The defer keyword -- Using pointer variables in functions -- Go data structures -- Arrays -- Slices -- Maps -- Converting an array into a map -- Structures -- Interfaces -- Creating random numbers -- Exercises -- Summary -- Chapter 3: Advanced Go Features -- Error handling in Go -- Functions can return error variables -- About error logging -- The addCLA.go program revisited -- Pattern matching and regular expressions -- Printing all the values from a given column of a line -- Creating summaries -- Finding the number of occurrences -- Find and replace -- Reflection -- Calling C code from Go -- Unsafe code -- Comparing Go to other programming languages -- Analysing software -- Using the strace(1) command-line utility -- The DTrace utility -- Disabling System Integrity Protection on macOS -- Unreachable code -- Avoiding common Go mistakes -- Exercises -- Summary -- Chapter 4: Go Packages, Algorithms, and Data Structures -- About algorithms -- The Big O notation -- Sorting algorithms
The sort.Slice() function -- Linked lists in Go -- Trees in Go -- Developing a hash table in Go -- About Go packages -- Using standard Go packages -- Creating your own packages -- Private variables and functions -- The init() function -- Using your own Go packages -- Using external Go packages -- The go clean command -- Garbage collection -- Your environment -- Go gets updated frequently! -- Exercises -- Summary -- Chapter 5: Files and Directories -- Useful Go packages -- Command-line arguments revisited! -- The flag package -- Dealing with directories -- About symbolic links -- Implementing the pwd(1) command -- Developing the which(1) utility in Go -- Printing the permission bits of a file or directory -- Dealing with files in Go -- Deleting a file -- Renaming and moving files -- Developing find(1) in Go -- Traversing a directory tree -- Visiting directories only! -- The first version of find(1) -- Adding some command-line options -- Excluding filenames from the find output -- Excluding a file extension from the find output -- Using regular expressions -- Creating a copy of a directory structure -- Exercises -- Summary -- Chapter 6: File Input and Output -- About file input and output -- Byte slices -- About binary files -- Useful I/O packages in Go -- The io package -- The bufio package -- File I/O operations -- Writing to files using fmt.Fprintf() -- About io.Writer and io.Reader -- Finding out the third column of a line -- Copying files in Go -- There is more than one way to copy a file! -- Copying text files -- Using io.Copy -- Reading a file all at once! -- An even better file copy program -- Benchmarking file copying operations -- Developing wc(1) in Go -- Counting words -- The wc.go code! -- Comparing the performance of wc.go and wc(1) -- Reading a text file character by character -- Doing some file editing! -- Interprocess communication
Sparse files in Go -- Reading and writing data records -- File locking in Go -- A simplified Go version of the dd utility -- Exercises -- Summary -- Chapter 7: Working with System Files -- Which files are considered system files? -- Logging in Go -- Putting data at the end of a file -- Altering existing data -- About log files -- About logging -- Logging facilities -- Logging levels -- The syslog Go package -- Processing log files -- File permissions revisited -- Changing file permissions -- Finding other kinds of information about files -- More pattern matching examples -- A simple pattern matching example -- An advanced example of pattern matching -- Renaming multiple files using regular expressions -- Searching files revisited -- Finding the user ID of a user -- Finding all the groups a user belongs to -- Finding files that belong or do not belong to a given user -- Finding files based on their permissions -- Date and time operations -- Playing with dates and times -- Reformatting the times in a log file -- Rotating log files -- Creating good random passwords -- Another Go update -- Exercises -- Summary -- Chapter 8: Processes and Signals -- About Unix processes and signals -- Process management -- About Unix signals -- Unix signals in Go -- The kill(1) command -- A simple signal handler in Go -- Handling three different signals! -- Catching every signal that can be handled -- Rotating log files revisited! -- Improving file copying -- Plotting data -- Unix pipes in Go -- Reading from standard input -- Sending data to standard output -- Implementing cat(1) in Go -- The plotIP.go utility revisited -- Unix sockets in Go -- RPC in Go -- Programming a Unix shell in Go -- Yet another minor Go update -- Exercises -- Summary -- Chapter 9: Goroutines -- Basic Features -- About goroutines -- Concurrency and parallelism -- The sync Go packages
A simple example -- Creating multiple goroutines -- Waiting for goroutines to finish their jobs -- Creating a dynamic number of goroutines -- About channels -- Writing to a channel -- Reading from a channel -- Explaining h1s.go -- Pipelines -- A better version of wc.go -- Calculating totals -- Doing some benchmarking -- Exercises -- Summary -- Chapter 10: Goroutines -- Advanced Features -- The Go scheduler -- The sync Go package -- The select keyword -- Signal channels -- Buffered channels -- About timeouts -- An alternative way to implement timeouts -- Channels of channels -- Nil channels -- Shared memory -- Using sync.Mutex -- Using sync.RWMutex -- The dWC.go utility revisited -- Using a buffered channel -- Using shared memory -- More benchmarking -- Detecting race conditions -- About GOMAXPROCS -- Exercises -- Summary -- Chapter 11: Writing Web Applications in Go -- What is a web application? -- About the net/http Go package -- Developing web clients -- Fetching a single URL -- Setting a timeout -- Developing better web clients -- A small web server -- The http.ServeMux type -- Using http.ServeMux -- The html/template package -- About JSON -- Saving JSON data -- Parsing JSON data -- Using Marshal() and Unmarshal() -- Using MongoDB -- Basic MongoDB administration -- Using the MongoDB Go driver -- Creating a Go application that displays MongoDB data -- Creating an application that displays MySQL data -- A handy command-line utility -- Exercises -- Summary -- Chapter 12: Network Programming -- About network programming -- About TCP/IP -- About TCP -- The TCP handshake! -- About UDP and IP -- About Wireshark and tshark -- About the netcat utility -- The net Go standard package -- Unix sockets revisited -- A Unix socket server -- A Unix socket client -- Performing DNS lookups -- Using an IP address as input -- Using a host name as input
Getting NS records for a domain -- Developing a simple TCP server -- Developing a simple TCP client -- Using other functions for the TCP server -- Using alternative functions for the TCP client -- Developing a simple UDP server -- Developing a simple UDP client -- A concurrent TCP server -- Remote procedure call (RPC) -- An RPC server -- An RPC client -- Exercises -- Summary -- Index
Summary Learning the new system's programming language for all Unix-type systems About This Book Learn how to write system's level code in Golang, similar to Unix/Linux systems code Ramp up in Go quickly Deep dive into Goroutines and Go concurrency to be able to take advantage of Go server-level constructs Who This Book Is For Intermediate Linux and general Unix programmers. Network programmers from beginners to advanced practitioners. C and C++ programmers interested in different approaches to concurrency and Linux systems programming. What You Will Learn Explore the Go language from the standpoint of a developer conversant with Unix, Linux, and so on Understand Goroutines, the lightweight threads used for systems and concurrent applications Learn how to translate Unix and Linux systems code in C to Golang code How to write fast and lightweight server code Dive into concurrency with Go Write low-level networking code In Detail Go is the new systems programming language for Linux and Unix systems. It is also the language in which some of the most prominent cloud-level systems have been written, such as Docker. Where C programmers used to rule, Go programmers are in demand to write highly optimized systems programming code. Created by some of the original designers of C and Unix, Go expands the systems programmers toolkit and adds a mature, clear programming language. Traditional system applications become easier to write since pointers are not relevant and garbage collection has taken away the most problematic area for low-level systems code: memory management. This book opens up the world of high-performance Unix system applications to the beginning Go programmer. It does not get stuck on single systems or even system types, but tries to expand the original teachings from Unix system level programming to all types of servers, the cloud, and the web. Style and approach This is the first book to introduce Linux and Unix systems programming in Go, a field for which Go has actually been developed in the first place. Downloading the example code for this book. You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the code file
Notes Online resource; title from title page (Safari, viewed October 24, 2017)
SUBJECT UNIX (Computer file) http://id.loc.gov/authorities/names/n91019960
Linux. http://id.loc.gov/authorities/names/n94087892
Linux fast
UNIX (Computer file) fast
Subject Go (Computer program language)
Computer programming.
computer programming.
COMPUTERS -- Programming -- General.
COMPUTERS -- Operating Systems -- Linux.
COMPUTERS -- Software Development & Engineering -- General.
Computer programming
Go (Computer program language)
Form Electronic book
ISBN 1787123154
9781787123151
Other Titles Master Linux and Unix system level programming with Go