You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
# shrt
|
|
|
|
|
|
|
|
Shrt is a url shortner writen in Go and by (Polr)[https://polr.me/index.php].
|
|
|
|
|
|
|
|
|
|
|
|
## Features
|
|
|
|
|
|
|
|
[x] No duplicated URL
|
|
|
|
[x] Simple UI
|
|
|
|
[x] DB simple json file
|
|
|
|
[x] Count URL views
|
|
|
|
[] Statistiks
|
|
|
|
[] Delete URL
|
|
|
|
[] Login
|
|
|
|
|
|
|
|
|
|
|
|
## Problem
|
|
|
|
Problem liegt derzeit bei der Verwendung von shrt.Get mit der übergabe eines inteface.
|
|
|
|
|
|
|
|
```
|
|
|
|
package main
|
|
|
|
|
|
|
|
...
|
|
|
|
|
|
|
|
var redirect string
|
|
|
|
if ok := shrt.Get(token, &redirect); ok {
|
|
|
|
// do something with the redirect.
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
Entgegen genommen wird es bei `lib/shrt.go`:
|
|
|
|
|
|
|
|
```
|
|
|
|
// Get returns the URL for the given token
|
|
|
|
func (s *Storage) Get(token string, value interface{}) bool {
|
|
|
|
if hash, ok := s.Token[token]; ok {
|
|
|
|
fmt.Printf("Url gefunden %s mit Hash: %v \n", s.Url[hash].URL, hash)
|
|
|
|
value = s.Url[hash].URL
|
|
|
|
fmt.Printf("Value: %V \n", value)
|
|
|
|
return true
|
|
|
|
}
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
Ich dachte eigentlich ich könne redirect damit manipulieren wenn ich es als pointer auf redirect übergebe aber das scheint nicht so zu sein....
|
|
|
|
|
|
|
|
|