Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't seem to figure out how layeredcache works because it doesnt work. #19

Closed
unisqu opened this issue Oct 31, 2018 · 1 comment
Closed

Comments

@unisqu
Copy link

unisqu commented Oct 31, 2018

why doesnt the below work? also, am i doing it right? i've tried multiple different ways. there's no error shown... pls help thx.

i realised it seems to stuck at displaying the value... if not initialized. how do i resolve? I think (int) for nil will jam without error displayed

     package httpcachetesting

     import (
           "github.com/karlseguin/ccache"
           "fmt"
      )

   var (
            HttpContentCache = ccache.Layered(ccache.Configure())
     )

    func HTTPCacheGet(urlhost string, urlreq string) (int, []byte, []byte, int, bool) {

              fmt.Printf("*** Start\n")
             httpcaches := HttpContentCache.Get(urlhost, "s"+urlreq) //same as stored in redis

              fmt.Printf("*** THIS MSG IS NOT SHOWING?!?!?! V : %v\n", httpcaches.Value().(int))

            

     }
@unisqu
Copy link
Author

unisqu commented Oct 31, 2018

i resolved it. needed to do type assertion. thx.
great software.

@unisqu unisqu closed this as completed Oct 31, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant