(timeout time.Duration)
| 156 | } |
| 157 | |
| 158 | func (hk *HelloKite) WaitTokenExpired(timeout time.Duration) error { |
| 159 | if !hk.Token { |
| 160 | return errors.New("kite is not authenticated with token") |
| 161 | } |
| 162 | |
| 163 | select { |
| 164 | case <-hk.toks: |
| 165 | return nil |
| 166 | case <-time.After(timeout): |
| 167 | return fmt.Errorf("waiting for token to expire timed out after %s", timeout) |
| 168 | } |
| 169 | } |
| 170 | |
| 171 | func (hk *HelloKite) WaitTokenRenew(timeout time.Duration) error { |
| 172 | if !hk.Token { |