Documentation ¶
Index ¶
- Variables
- type Message
- type RayClient
- type RayEntry
- func Caller() *RayEntry
- func Charles() *RayEntry
- func ClearScreen() *RayEntry
- func Custom(content string, label string) *RayEntry
- func DumpStruct(obj interface{}) *RayEntry
- func JSON(obj interface{}) *RayEntry
- func JSONString(jsonString string) *RayEntry
- func NewRayEntry(client *RayClient, id string) *RayEntry
- func NewScreen(screenName string) *RayEntry
- func Notify(text string) *RayEntry
- func Ray(objs ...interface{}) *RayEntry
- func Reader(reader io.Reader) *RayEntry
- func Request(req *http.Request) *RayEntry
- func SetColor(color string) *RayEntry
- func SetSize(size string) *RayEntry
- func Trace() *RayEntry
- func TypeName(obj interface{}) *RayEntry
- func (r *RayEntry) Caller() *RayEntry
- func (r *RayEntry) Charles() *RayEntry
- func (r *RayEntry) ClearScreen() *RayEntry
- func (r *RayEntry) Clone() *RayEntry
- func (r *RayEntry) Custom(content string, label string) *RayEntry
- func (r *RayEntry) DumpStruct(obj interface{}) *RayEntry
- func (r *RayEntry) Hide() *RayEntry
- func (r *RayEntry) JSON(obj interface{}) *RayEntry
- func (r *RayEntry) JSONString(jsonString string) *RayEntry
- func (r *RayEntry) NewScreen(name string) *RayEntry
- func (r *RayEntry) Notify(text string) *RayEntry
- func (r *RayEntry) Ray(obj ...interface{}) *RayEntry
- func (r *RayEntry) Reader(reader io.Reader) *RayEntry
- func (r *RayEntry) Remove() *RayEntry
- func (r *RayEntry) Request(req *http.Request) *RayEntry
- func (r *RayEntry) SetColor(color string) *RayEntry
- func (r *RayEntry) SetSize(size string) *RayEntry
- func (r *RayEntry) Trace() *RayEntry
- func (r *RayEntry) TypeName(obj interface{}) *RayEntry
- func (r *RayEntry) WithColor(color string) *RayEntry
- func (r *RayEntry) WithSize(size string) *RayEntry
Constants ¶
This section is empty.
Variables ¶
var ( // DefaultClient to ray app DefaultClient *RayClient = NewRayClient("localhost", 23517) // DefaultRayEntry with current settings DefaultRayEntry *RayEntry = NewRayEntry(DefaultClient, "") )
Functions ¶
This section is empty.
Types ¶
type Message ¶
type Message struct { UUID string `json:"uuid"` Payloads []map[string]interface{} `json:"payloads"` Meta map[string]string `json:"meta"` }
Message to communicate with the ray app
type RayClient ¶
type RayClient struct { Enabled bool `json:"enable"` Host string `json:"host"` Port int `json:"port"` }
RayClient contains the configuration to Ray App
func NewRayClient ¶
NewRayClient create a client
type RayEntry ¶
type RayEntry struct { Client *RayClient // Color that can be used are green, orange, red, blue, purple and gray. An // empty string removes the color. Color string // Size that can be used are sm, lg or an empty string. Size string // UUID of the last message UUID string }
RayEntry is the final or intermediate ray entry. It contains color, size and the final uuid. These objects can be reused to avoid having to redefine font size or color.
func ClearScreen ¶
func ClearScreen() *RayEntry
ClearScreen creates a new screen with empty entry list.
func DumpStruct ¶
func DumpStruct(obj interface{}) *RayEntry
DumpStruct print the struct at ray. Requires a pointer.
func JSONString ¶
JSONString send a string with json as json string
func NewRayEntry ¶
NewRayEntry creates a new RayEntry with default settings. If the UUID is empty, a new one is generated. The UUID is overwritten with each new message.
func NewScreen ¶
NewScreen creates a new screen with optional name. All following entries will be displayed on this screen.
func Trace ¶
func Trace() *RayEntry
Trace sent the trace as custom message to Ray. Unfortunately, Ray's trace message is not easy to fill with the go trace.
func TypeName ¶
func TypeName(obj interface{}) *RayEntry
TypeName send the type name to ray as custom message
func (*RayEntry) ClearScreen ¶
ClearScreen creates a new screen with empty entry list.
func (*RayEntry) DumpStruct ¶
DumpStruct print the struct at ray. Requires a pointer.
func (*RayEntry) JSONString ¶
JSONString send a string with json as json string
func (*RayEntry) NewScreen ¶
NewScreen creates a new screen with optional name. All following entries will be displayed on this screen.
func (*RayEntry) Trace ¶
Trace sent the trace as custom message to Ray. Unfortunately, Ray's trace message is not easy to fill with the go trace.