Documentation ¶
Index ¶
- Constants
- func InitConf(c *SysConf)
- type Geo
- type HttpConf
- type LogicAction
- type MainService
- type Media
- type OuterLinkParam
- type PageData
- type Poll
- type Reply
- type SessionManager
- type SignDataByEth
- type SignInObj
- type SysConf
- type TwAPIResponse
- type TweetImgData
- type TweetPostResult
- type TweetRequest
- type TweetResponse
- type TwitterConf
- type VerifiedTwitterUser
- type Web3BindingData
Constants ¶
View Source
const ( NjTweetID = "NjTID" )
View Source
const ( MaxImgInTweet = 4 MaxImgDataSize = 1 << 20 )
View Source
const (
BuyRightsUrlKey = "tweet-info-from-outer-link"
)
View Source
const (
MaxIntervalForPaymentStatus = 60
)
View Source
const (
SessionNameSystem = "session-name-for-ninja"
)
View Source
const (
Web3IDProfile = "Dessage-Web3-ID:"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type HttpConf ¶
type HttpConf struct { RefreshContent bool `json:"refresh_content"` UseHttps bool `json:"use_https"` SSLCertFile string `json:"ssl_cert_file"` SSLKeyFile string `json:"ssl_key_file"` SessionKey string `json:"session_key"` SessionMaxAge int `json:"session_max_age"` // contains filtered or unexported fields }
type LogicAction ¶
type LogicAction struct { Action func(w http.ResponseWriter, r *http.Request, token *database.NinjaUsrInfo) NeedToken bool }
type MainService ¶
type MainService struct {
// contains filtered or unexported fields
}
func NewMainService ¶
func NewMainService() *MainService
func (*MainService) Start ¶
func (bh *MainService) Start()
type OuterLinkParam ¶ added in v1.0.1
type OuterLinkParam struct { TweetID string `json:"tweet_id,omitempty"` }
func (*OuterLinkParam) Data ¶ added in v1.0.1
func (p *OuterLinkParam) Data() []byte
func (*OuterLinkParam) GetValidId ¶ added in v1.0.1
func (p *OuterLinkParam) GetValidId() string
type SessionManager ¶
type SessionManager struct {
// contains filtered or unexported fields
}
func SMInst ¶
func SMInst() *SessionManager
func (*SessionManager) Del ¶
func (sm *SessionManager) Del(key string, r *http.Request, w http.ResponseWriter) error
func (*SessionManager) Set ¶
func (sm *SessionManager) Set(r *http.Request, w http.ResponseWriter, key string, val any) error
type SignDataByEth ¶
type SignDataByEth struct { Message string `json:"message"` Signature string `json:"signature"` PayLoad any `json:"pay_load,omitempty"` }
func (*SignDataByEth) ParseNinjaTweet ¶
func (sp *SignDataByEth) ParseNinjaTweet() (*database.NinjaTweet, error)
func (*SignDataByEth) RawData ¶
func (sp *SignDataByEth) RawData() string
type SignInObj ¶
type SysConf ¶
type SysConf struct { LogLevel string `json:"log_level"` LogFile string `json:"log_file"` UrlHome string `json:"url_home"` HttpPort string `json:"http_port"` JSEnv string `json:"js_env"` *HttpConf *TwitterConf *database.FileStoreConf *blockchain.BCConf // contains filtered or unexported fields }
func (*SysConf) GetNjProtocolAd ¶
func (*SysConf) GetNjVoteAd ¶ added in v1.0.1
type TwAPIResponse ¶
type TwAPIResponse struct { TwitterData *database.TWUserInfo `json:"data"` EthAddr string `json:"eth_addr"` SignUpAt int64 `json:"sign_up_at"` CSRFToken string }
type TweetImgData ¶ added in v1.0.1
type TweetPostResult ¶
type TweetRequest ¶
type TweetRequest struct { Text string `json:"text,omitempty"` DirectMessageDeepLink string `json:"direct_message_deep_link,omitempty"` ForSuperFollowersOnly bool `json:"for_super_followers_only,omitempty"` Geo *Geo `json:"geo,omitempty"` Media *Media `json:"media,omitempty"` Poll *Poll `json:"poll,omitempty"` QuoteTweetID string `json:"quote_tweet_id,omitempty"` Reply *Reply `json:"reply,omitempty"` ReplySettings string `json:"reply_settings,omitempty"` }
type TweetResponse ¶
type TweetResponse struct {
Data TweetPostResult `json:"data"`
}
type TwitterConf ¶
type TwitterConf struct { ClientID string `json:"client_id"` ClientSecret string `json:"client_secret"` ConsumerKey string `json:"consumer_key"` ConsumerSecret string `json:"consumer_secret"` }
func (*TwitterConf) String ¶
func (c *TwitterConf) String() string
type VerifiedTwitterUser ¶
type VerifiedTwitterUser struct { ContributorsEnabled bool `json:"contributors_enabled"` CreatedAt string `json:"created_at"` DefaultProfile bool `json:"default_profile"` DefaultProfileImage bool `json:"default_profile_image"` Description string `json:"description"` FavouritesCount int `json:"favourites_count"` FollowersCount int `json:"followers_count"` FriendsCount int `json:"friends_count"` GeoEnabled bool `json:"geo_enabled"` ID int64 `json:"id"` IDStr string `json:"id_str"` IsTranslator bool `json:"is_translator"` Lang string `json:"lang"` ListedCount int `json:"listed_count"` Location string `json:"location"` Name string `json:"name"` ProfileBackgroundColor string `json:"profile_background_color"` ProfileBackgroundImageUrl string `json:"profile_background_image_url"` ProfileBackgroundImageUrlHttps string `json:"profile_background_image_url_https"` ProfileBackgroundTile bool `json:"profile_background_tile"` ProfileImageUrl string `json:"profile_image_url"` ProfileImageUrlHttps string `json:"profile_image_url_https"` ProfileLinkColor string `json:"profile_link_color"` ProfileSidebarBorderColor string `json:"profile_sidebar_border_color"` ProfileSidebarFillColor string `json:"profile_sidebar_fill_color"` ProfileTextColor string `json:"profile_text_color"` ProfileUseBackgroundImage bool `json:"profile_use_background_image"` Protected bool `json:"protected"` ScreenName string `json:"screen_name"` ShowAllInlineMedia bool `json:"show_all_inline_media"` StatusesCount int `json:"statuses_count"` TimeZone string `json:"time_zone"` URL string `json:"url"` UtcOffset int `json:"utc_offset"` Verified bool `json:"verified"` }
type Web3BindingData ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.