ffjson

package
v0.0.0-...-9074d79 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2016 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BenchBasicMemInfo

func BenchBasicMemInfo() []benchutil.Bench

BenchBasicMemInfo runs the BasicMemInfo benches for Marshal/Unmarshal.

func BenchCPUInfo

func BenchCPUInfo(n int) []benchutil.Bench

BenchCPUInfo runs the CPUInfo benches for Marshal/Unmarshal.

func BenchMemInfo

func BenchMemInfo() []benchutil.Bench

BenchMemInfo runs the MemInfo benches for Marshal/Unmarshal.

func BenchMessage

func BenchMessage(l int) []benchutil.Bench

BenchMessage runs the MemInfo benches for Marshal/Unmarshal.

func BenchRedditAccount

func BenchRedditAccount() []benchutil.Bench

BenchRedditAccount runs the MemInfo benches for Marshal/Unmarshal.

Types

type AccountData

type AccountData struct {
	CommentKarma int64  `json:"comment_karma"`
	HasMail      bool   `json:"has_mail"`
	HasModMail   bool   `json:"has_mod_mail"`
	ID           string `json:"id"`
	InboxCount   int64  `json:"inbox_count"`
	IsFriend     bool   `json:"is_friend"`
	IsGold       bool   `json:"is_gold"`
	LinkKarma    int64  `json:"link_karma"`
	ModHash      string `json:"mod_hash"`
	Name         string `json:"name"`
	Over18       bool   `json:"over_18"`
}

func (*AccountData) MarshalJSON

func (mj *AccountData) MarshalJSON() ([]byte, error)

func (*AccountData) MarshalJSONBuf

func (mj *AccountData) MarshalJSONBuf(buf fflib.EncodingBuffer) error

func (*AccountData) UnmarshalJSON

func (uj *AccountData) UnmarshalJSON(input []byte) error

func (*AccountData) UnmarshalJSONFFLexer

func (uj *AccountData) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error

type BasicMemInfo

type BasicMemInfo struct {
	MemTotal     int64 `json:"mem_total"`
	MemFree      int64 `json:"mem_free"`
	MemAvailable int64 `json:"mem_available"`
	Buffers      int64 `json:"buffers"`
	Cached       int64 `json:"cached"`
	SwapCached   int64 `json:"swap_cached"`
	SwapTotal    int64 `json:"swap_total"`
	SwapFree     int64 `json:"swap_free"`
}

func PrepareBasicMemInfoData

func PrepareBasicMemInfoData(data []shared.ShBasicMemInfo) []BasicMemInfo

PrepareBasicMemInfoData generates the ffjson version of the data.

func (*BasicMemInfo) MarshalJSON

func (mj *BasicMemInfo) MarshalJSON() ([]byte, error)

func (*BasicMemInfo) MarshalJSONBuf

func (mj *BasicMemInfo) MarshalJSONBuf(buf fflib.EncodingBuffer) error

func (*BasicMemInfo) UnmarshalJSON

func (uj *BasicMemInfo) UnmarshalJSON(input []byte) error

func (*BasicMemInfo) UnmarshalJSONFFLexer

func (uj *BasicMemInfo) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error

type CPU

type CPU struct {
	Processor       int16   `json:"processor"`
	VendorID        string  `json:"vendor_id"`
	CPUFamily       string  `json:"cpu_family"`
	Model           string  `json:"model"`
	ModelName       string  `json:"model_name"`
	Stepping        string  `json:"stepping"`
	Microcode       string  `json:"microcode"`
	CPUMHz          float32 `json:"cpu_mhz"`
	CacheSize       string  `json:"cache_size"`
	PhysicalID      int16   `json:"physical_id"`
	Siblings        int16   `json:"siblings"`
	CoreID          int16   `json:"core_id"`
	CPUCores        int16   `json:"cpu_cores"`
	ApicID          int16   `json:"apicid"`
	InitialApicID   int16   `json:"initial_apicid"`
	FPU             string  `json:"fpu"`
	FPUException    string  `json:"fpu_exception"`
	CPUIDLevel      string  `json:"cpuid_level"`
	WP              string  `json:"wp"`
	Flags           string  `json:"flags"`
	BogoMIPS        float32 `json:"bogomips"`
	CLFlushSize     string  `json:"clflush_size"`
	CacheAlignment  string  `json:"cache_alignment"`
	AddressSizes    string  `json:"address_sizes"`
	PowerManagement string  `json:"power_management"`
}

func (*CPU) MarshalJSON

func (mj *CPU) MarshalJSON() ([]byte, error)

func (*CPU) MarshalJSONBuf

func (mj *CPU) MarshalJSONBuf(buf fflib.EncodingBuffer) error

func (*CPU) UnmarshalJSON

func (uj *CPU) UnmarshalJSON(input []byte) error

func (*CPU) UnmarshalJSONFFLexer

func (uj *CPU) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error

type CPUInfo

type CPUInfo struct {
	CPUs []CPU `json:"cpus"`
}

func PrepareCPUInfoData

func PrepareCPUInfoData(data []shared.ShCPUInfo) []CPUInfo

PrepareCPUInfoData generates the ffjson version of the data.

func (*CPUInfo) MarshalJSON

func (mj *CPUInfo) MarshalJSON() ([]byte, error)

func (*CPUInfo) MarshalJSONBuf

func (mj *CPUInfo) MarshalJSONBuf(buf fflib.EncodingBuffer) error

func (*CPUInfo) UnmarshalJSON

func (uj *CPUInfo) UnmarshalJSON(input []byte) error

func (*CPUInfo) UnmarshalJSONFFLexer

func (uj *CPUInfo) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error

type MemInfo

type MemInfo struct {
	MemTotal          int64 `json:"mem_total"`
	MemFree           int64 `json:"mem_free"`
	MemAvailable      int64 `json:"mem_available"`
	Buffers           int64 `json:"buffers"`
	Cached            int64 `json:"cached"`
	SwapCached        int64 `json:"swap_cached"`
	Active            int64 `json:"active"`
	Inactive          int64 `json:"inactive"`
	ActiveAnon        int64 `json:"active_anon"`
	InactiveAnon      int64 `json:"inactive_anon"`
	ActiveFile        int64 `json:"active_file"`
	InactiveFile      int64 `json:"inactive_file"`
	Unevictable       int64 `json:"unevictable"`
	Mlocked           int64 `json:"mlocked"`
	SwapTotal         int64 `json:"swap_total"`
	SwapFree          int64 `json:"swap_free"`
	Dirty             int64 `json:"dirty"`
	Writeback         int64 `json:"writeback"`
	AnonPages         int64 `json:"anon_pages"`
	Mapped            int64 `json:"mapped"`
	Shmem             int64 `json:"sh_mem"`
	Slab              int64 `json:"slab"`
	SReclaimable      int64 `json:"s_reclaimable"`
	SUnreclaim        int64 `json:"s_unreclaim"`
	KernelStack       int64 `json:"kernel_stack"`
	NFSUnstable       int64 `json:"nfs_unstable"`
	Bounce            int64 `json:"bounce"`
	WritebackTmp      int64 `json:"writeback_tmp"`
	CommitLimit       int64 `json:"commit_limit"`
	VmallocTotal      int64 `json:"vmalloc_total"`
	VmallocUsed       int64 `json:"vmalloc_used"`
	VmallocChunk      int64 `json:"vmalloc_chunked"`
	HardwareCorrupted int64 `json:"hardware_corrupted"`
	AnonHugePages     int64 `json:"anon_huge_pages"`
	HugePagesTotal    int64 `json:"huge_pages_total"`
	HugePagesFree     int64 `json:"huge_pages_free"`
	HugePagesRsvd     int64 `json:"huge_pages_rsvd"`
	Hugepagesize      int64 `json:"huge_pages_size"`
	DirectMap4k       int64 `json:"direct_map_4k"`
	DirectMap2M       int64 `json:"direct_map_2m"`
}

func PrepareMemInfoData

func PrepareMemInfoData(data []shared.ShMemInfo) []MemInfo

PrepareMemInfoData generates the ffjson version of the data.

func (*MemInfo) MarshalJSON

func (mj *MemInfo) MarshalJSON() ([]byte, error)

func (*MemInfo) MarshalJSONBuf

func (mj *MemInfo) MarshalJSONBuf(buf fflib.EncodingBuffer) error

func (*MemInfo) UnmarshalJSON

func (uj *MemInfo) UnmarshalJSON(input []byte) error

func (*MemInfo) UnmarshalJSONFFLexer

func (uj *MemInfo) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error

type Message

type Message struct {
	ID     []byte `json:"id"`
	DestID uint32 `json:"dest_id"`
	Type   int8   `json:"type"`
	Kind   int16  `json:"kind"`
	Data   []byte `json:"data"`
}

func PrepareMessageData

func PrepareMessageData(data []shared.ShMessage) []Message

PrepareMessageData generates the ffjson version of the data.

func (*Message) MarshalJSON

func (mj *Message) MarshalJSON() ([]byte, error)

func (*Message) MarshalJSONBuf

func (mj *Message) MarshalJSONBuf(buf fflib.EncodingBuffer) error

func (*Message) UnmarshalJSON

func (uj *Message) UnmarshalJSON(input []byte) error

func (*Message) UnmarshalJSONFFLexer

func (uj *Message) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error

type RedditAccount

type RedditAccount struct {
	ID   string      `json:"id"`
	Name string      `json:"name"`
	Kind string      `json:"kind"`
	Data AccountData `json:"data"`
}

func PrepareRedditAccountData

func PrepareRedditAccountData(data []shared.ShRedditAccount) []RedditAccount

PrepareRedditAccountData generates the ffjson version of the data.

func (*RedditAccount) MarshalJSON

func (mj *RedditAccount) MarshalJSON() ([]byte, error)

func (*RedditAccount) MarshalJSONBuf

func (mj *RedditAccount) MarshalJSONBuf(buf fflib.EncodingBuffer) error

func (*RedditAccount) UnmarshalJSON

func (uj *RedditAccount) UnmarshalJSON(input []byte) error

func (*RedditAccount) UnmarshalJSONFFLexer

func (uj *RedditAccount) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error

Jump to

Keyboard shortcuts

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