-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5830756
commit b46ea2e
Showing
6 changed files
with
115 additions
and
159 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package pttbbs | ||
|
||
import apipb "github.com/ptt/pttweb/proto/api" | ||
|
||
type boardRefByBid BoardID | ||
|
||
func (r boardRefByBid) boardRef() *apipb.BoardRef { | ||
return &apipb.BoardRef{Ref: &apipb.BoardRef_Bid{uint32(r)}} | ||
} | ||
|
||
func BoardRefByBid(bid BoardID) BoardRef { | ||
return boardRefByBid(bid) | ||
} | ||
|
||
func BoardRefsByBid(bids []BoardID) []BoardRef { | ||
refs := make([]BoardRef, len(bids)) | ||
for i := range bids { | ||
refs[i] = BoardRefByBid(bids[i]) | ||
} | ||
return refs | ||
} | ||
|
||
type boardRefByName string | ||
|
||
func (r boardRefByName) boardRef() *apipb.BoardRef { | ||
return &apipb.BoardRef{Ref: &apipb.BoardRef_Name{string(r)}} | ||
} | ||
|
||
func BoardRefByName(name string) BoardRef { | ||
return boardRefByName(name) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.