github.com/lmorg/murex@v0.0.0-20240217211045-e081c89cd4ef/builtins/types/apachelogs/marshal.go (about)

     1  package apachelogs
     2  
     3  import (
     4  	"github.com/lmorg/apachelogs"
     5  	"github.com/lmorg/murex/lang"
     6  )
     7  
     8  func unmarshal(p *lang.Process) (interface{}, error) {
     9  	var log []apachelogs.AccessLine
    10  
    11  	p.Stdin.ReadLine(func(b []byte) {
    12  		line, err, _ := apachelogs.ParseAccessLine(string(b))
    13  		if err != nil {
    14  			return
    15  		}
    16  
    17  		log = append(log, *line)
    18  	})
    19  
    20  	return log, nil
    21  }