Skip to content

Commit

Permalink
update pdk methods (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
javierguerragiraldez authored Jan 8, 2021
1 parent 19d1f37 commit bc4a8a2
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions log/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,28 @@ func (r Log) Debug(args ...interface{}) error {
return err
}

var (
modeSet = map[string]string{ "mode": "set" }
modeAdd = map[string]string{ "mode": "add" }
modeReplace = map[string]string{ "mode": "replace" }
)

func (r Log) SetSerializeValue(key string, v interface{}) error {
_, err := r.Ask(`kong.log.set_serialize_value`, key, v, modeSet)
return err
}

func (r Log) SetSerializeValueAdd(key string, v interface{}) error {
_, err := r.Ask(`kong.log.set_serialize_value`, key, v, modeAdd)
return err
}

func (r Log) SetSerializeValueReplace(key string, v interface{}) error {
_, err := r.Ask(`kong.log.set_serialize_value`, key, v, modeReplace)
return err
}


func (r Log) Serialize() (s string, err error) {
return r.AskString(`kong.log.serialize`)
}

0 comments on commit bc4a8a2

Please sign in to comment.