github.com/gop9/olt@v0.0.0-20200202132135-d956aad50b08/gio/io/profile/profile.go (about) 1 // SPDX-License-Identifier: Unlicense OR MIT 2 3 // Package profiles provides access to rendering 4 // profiles. 5 package profile 6 7 import ( 8 "github.com/gop9/olt/gio/internal/opconst" 9 "github.com/gop9/olt/gio/io/event" 10 "github.com/gop9/olt/gio/op" 11 ) 12 13 // Op registers a handler for receiving 14 // Events. 15 type Op struct { 16 Key event.Key 17 } 18 19 // Event contains profile data from a single 20 // rendered frame. 21 type Event struct { 22 // Timings. Very likely to change. 23 Timings string 24 } 25 26 func (p Op) Add(o *op.Ops) { 27 data := o.Write(opconst.TypeProfileLen, p.Key) 28 data[0] = byte(opconst.TypeProfile) 29 } 30 31 func (p Event) ImplementsEvent() {}