a

package
v0.2.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 4, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const A = 1

Constants with complex expressions

View Source
const B = 3
View Source
const BoolFromInt = true
View Source
const BoolFromString = true
View Source
const C = 9
View Source
const Complex1 = 5673

Constants for testing complex expressions and bitwise operations

View Source
const Complex2 = 78547
View Source
const Complex3 = 31
View Source
const Complex4 = 31
View Source
const Complex5 = 31
View Source
const D = 7
View Source
const E = 28
View Source
const F = 1052
View Source
const FloatFromBool = 0.0
View Source
const FloatFromInt = 42.0
View Source
const FormattedString1 = "The answer is 42"
View Source
const FormattedString2 = "Pi is approximately 3.14"
View Source
const FormattedString3 = "Hello World\n"
View Source
const G = 1052
View Source
const H = 5672
View Source
const I = 5673.618 // Approximation of golden ratio
View Source
const IntFromBool = 1

Constants using built-in functions

View Source
const IntFromFloat = 3
View Source
const J = 47.28015 // 120 is 5!
View Source
const MaxConnections = 1000
View Source
const MaxInt64 = 9223372036854775807 // 2^63 - 1
View Source
const MaxValue = 5673
View Source
const MinInt64 = -9223372036854775808 // -2^63
View Source
const MinValue = 1
View Source
const Pi = 3.14159265358979323846
View Source
const ServerName = "Comprehensive Test Server"

Constants

View Source
const StringLength = 13

Constants with function calls

View Source
const Version = "1.0.0"
View Source
const XX = 1 // XX value

XX constant XX value 2

Variables

This section is empty.

Functions

This section is empty.

Types

type Color

type Color int32

Enum with iota

const (
	ColorRed     Color = 1
	ColorGreen   Color = 2
	ColorBlue    Color = 4
	ColorAlpha   Color = 8
	ColorYellow  Color = 3
	ColorCyan    Color = 6
	ColorMagenta Color = 5
	ColorWhite   Color = 7
)

type ComplexStruct

type ComplexStruct struct {
	Flag            bool
	TinyInt         int8
	SmallInt        int16
	MediumInt       int32
	BigInt          int64
	DefaultInt      int
	SinglePrecision float32
	DoublePrecision float64
	Text            string
	SingleByte      byte
	ByteArray       []byte
	FixedArray      [5]int
	DynamicArray    []string
	IntArray        []int
	Dictionary      map[string]int
}

Struct with various field types

type Day

type Day int32
const (
	DayMonday    Day = 1
	DayTuesday   Day = 2
	DayWednesday Day = 4
	DayThursday  Day = 8
	DayFriday    Day = 16
	DaySaturday  Day = 32
	DaySunday    Day = 64
	DayWeekday   Day = 31
	DayWeekend   Day = 96
)

type FilePermission

type FilePermission int32

Enum with complex iota usage

const (
	FilePermissionNone          FilePermission = 0
	FilePermissionExecute       FilePermission = 1
	FilePermissionWrite         FilePermission = 2
	FilePermissionRead          FilePermission = 4
	FilePermissionUserRead      FilePermission = 4
	FilePermissionUserWrite     FilePermission = 32
	FilePermissionUserExecute   FilePermission = 256
	FilePermissionGroupRead     FilePermission = 2048
	FilePermissionGroupWrite    FilePermission = 16384
	FilePermissionGroupExecute  FilePermission = 131072
	FilePermissionOthersRead    FilePermission = 1048576
	FilePermissionOthersWrite   FilePermission = 8388608
	FilePermissionOthersExecute FilePermission = 67108864
	// 4|32|256|2048|16384|131072|1048576|8388608|67108864
	// 4 + 32 + 256 + 2048 + 16384 + 131072 + 1048576 + 8388608 + 67108864
	FilePermissionAll FilePermission = 76695844
)

type GenericRequest

type GenericRequest struct {
	RequestId string
	Timestamp int64
}

type GenericResponse

type GenericResponse struct {
	RequestId    string
	Timestamp    int64
	Success      bool
	ErrorCode    string
	ErrorMessage string
}

type IotatestEnum

type IotatestEnum int32

Test cases for iota

const (
	IotatestEnumA IotatestEnum = 0 // 0
	IotatestEnumB IotatestEnum = 1 // 1
	IotatestEnumC IotatestEnum = 0 // 0
	IotatestEnumD IotatestEnum = 2 // 2
	IotatestEnumE IotatestEnum = 0 // 0
	IotatestEnumF IotatestEnum = 1 // 1
	IotatestEnumG IotatestEnum = 0 // 0
)

type LoginRequest

type LoginRequest struct {
	Username       string
	Password       string
	DeviceId       string
	TwoFactorToken string
}

message types

func (LoginRequest) MessageType

func (LoginRequest) MessageType() int

type LoginResponse

type LoginResponse struct {
	Success             bool
	ErrorMessage        string
	AuthenticationToken string
	User                User
}

func (LoginResponse) MessageType

func (LoginResponse) MessageType() int

type Month

type Month int32
const (
	MonthJanuary   Month = 1
	MonthFebruary  Month = 2
	MonthMarch     Month = 4
	MonthApril     Month = 8
	MonthMay       Month = 16
	MonthJune      Month = 32
	MonthJuly      Month = 64
	MonthAugust    Month = 128
	MonthSeptember Month = 256
	MonthOctober   Month = 512
	MonthNovember  Month = 1024
	MonthDecember  Month = 2048
	MonthQ1        Month = 7
	MonthQ2        Month = 56
	MonthQ3        Month = 448
	MonthQ4        Month = 3584
)

type Point2D

type Point2D struct {
	X float64 // x-coordinate
	Y float64 // y-coordinate
}

Struct types

type Point3D

type Point3D struct {
	Point Point2D
	Z     float64
}

type Rectangle

type Rectangle struct {
	TopLeft     Point2D
	BottomRight Point2D
}

type User

type User struct {
	Id           int64
	Username     string
	Email        string
	PreferredDay Day
	BirthMonth   Month
}

type UserProfile

type UserProfile struct {
	User      User
	FirstName string
	LastName  string
	Age       int
	Interests []string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL