MCPcopy Create free account
hub / github.com/wavetermdev/waveterm / LastLinePtr

Method LastLinePtr

pkg/util/logview/logview.go:169–194  ·  view source on GitHub ↗
(linePtr *LinePtr)

Source from the content-addressed store, hash-verified

167}
168
169func (lv *LogView) LastLinePtr(linePtr *LinePtr) (*LinePtr, error) {
170 if linePtr == nil {
171 var err error
172 linePtr, err = lv.FirstLinePtr()
173 if err != nil {
174 return nil, err
175 }
176 }
177 if linePtr == nil {
178 return nil, nil
179 }
180 for {
181 nextLinePtr, err := lv.NextLinePtr(linePtr)
182 if err == io.EOF {
183 break
184 }
185 if err != nil {
186 return nil, err
187 }
188 if nextLinePtr == nil {
189 break
190 }
191 linePtr = nextLinePtr
192 }
193 return linePtr, nil
194}
195
196func (lv *LogView) ReadWindow(linePtr *LinePtr, winSize int) ([][]byte, error) {
197 if linePtr == nil {

Callers

nothing calls this directly

Calls 2

FirstLinePtrMethod · 0.95
NextLinePtrMethod · 0.95

Tested by

no test coverage detected