typing

package
v0.0.0-...-cadcef1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 13, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthCtxKey

type AuthCtxKey struct{}

type BodyCtxKey

type BodyCtxKey struct{}

type Env

type Env struct {
	//Port for the server to listen on
	Port string `env:"PORT"`
	//MongoDBURI is the monogoDB connection string for the app
	MongoDBURI string `env:"MONGO_DB_URI"`
	//MongoDBName is the MongoDB database name for the app
	MongoDBName string `env:"MONGO_DB_NAME"`

	// TwitterClientID is the twitter client id
	TwitterClientID string `env:"TWITTER_CLIENT_ID"`
	// TwitterClientSecret is the twitter client secret
	TwitterClientSecret string `env:"TWITTER_CLIENT_SECRET"`
	// TwitterAPIKey is the twitter api key
	TwitterAPIKey string `env:"TWITTER_API_KEY"`
	// TwitterAPISecretKey is the twitter api secret key
	TwitterAPISecretKey string `env:"TWITTER_API_SECRET_KEY"`
	// TwitterAccessToken is the twitter access token
	TwitterAccessToken string `env:"TWITTER_ACCESS_TOKEN"`
	// TwitterBearerToken is the twitter bearer token
	TwitterBearerToken string `env:"TWITTER_BEARER_TOKEN"`
	// TwitterAccessTokenSecret is the twitter access token secret
	TwitterAccessTokenSecret string `env:"TWITTER_ACCESS_TOKEN_SECRET"`
	// TwitterRedirectURL is the twitter redirect url
	TwitterRedirectURL string `env:"TWITTER_REDIRECT_URL"`

	// JWTSecret is the jwt secret
	JWTSecret string `env:"JWT_SECRET"`
	// AppName is the app name
	AppName string `env:"APP_NAME"`
}

type Health

type Health struct {
	Name    string `json:"name"`
	Status  bool   `json:"status"`
	Version string `json:"version"`
}

type Home

type Home struct {
	Status      bool   `json:"status"`
	Version     string `json:"version"`
	Description string `json:"description"`
	Name        string `json:"name"`
	Twitter     string `json:"twitter"`
}

type JWTClaims

type JWTClaims struct {
	ID string `json:"id"`
	jwt.RegisteredClaims
}

type M

type M map[string]interface{}

type ParamsCtxKey

type ParamsCtxKey struct{}

type Reply

type Reply struct {
	MID            primitive.ObjectID `json:"-" bson:"_id,omitempty"`
	ID             string             `json:"id" bson:"id"` // twitter id
	Text           string             `json:"text" bson:"text"`
	Username       string             `json:"username" bson:"username"`
	TweetID        string             `json:"tweet_id" bson:"tweet_id"`
	FText          string             `json:"f_text" bson:"f_text"`
	Giveaway       primitive.ObjectID `json:"giveaway" bson:"giveaway"`
	ConversationID string             `json:"conversation_id" bson:"conversation_id"`
	Claimed        bool               `json:"claimed" bson:"claimed"`
}

type Response

type Response struct {
	Status  bool        `json:"status"`
	Message string      `json:"message"`
	Data    interface{} `json:"data"`
}

type Social

type Social struct {
	Twitter   bool
	Instagram bool
}

type Twitter

type Twitter struct {
	ID           string    `json:"id" bson:"id"`
	Username     string    `json:"username" bson:"username"`
	AccessToken  string    `json:"access_token " bson:"access_token"`
	RefreshToken string    `json:"refresh_token" bson:"refresh_token"`
	TokenType    string    `json:"token_type" bson:"token_type"`
	RetrievedAt  time.Time `json:"retrieved_at" bson:"retrieved_at"`
	UpdatedAt    time.Time `json:"updated_at" bson:"updated_at"`
}

type TwitterAuthError

type TwitterAuthError struct {
	Error            string `json:"error"`
	ErrorDescription string `json:"error_description"`
}

type TwitterAuthResponse

type TwitterAuthResponse struct {
	AccessToken  string `json:"access_token"`
	TokenType    string `json:"token_type"`
	ExpiresIn    int    `json:"expires_in"`
	Scope        string `json:"scope"`
	RefreshToken string `json:"refresh_token"`
}

type TwitterDeleteTweetResponse

type TwitterDeleteTweetResponse struct {
	Data struct {
		Deteted bool `json:"deleted"`
	} `json:"data"`
}

type TwitterEmbedResponse

type TwitterEmbedResponse struct {
	HTML string `json:"html"`
	URL  string `json:"url"`
}

type TwitterLikeTweetResponse

type TwitterLikeTweetResponse struct {
	Data struct {
		Liked bool `json:"liked"`
	} `json:"data"`
}

type TwitterListResponse

type TwitterListResponse struct {
	Data []struct {
		ID             string `json:"id"`
		Name           string `json:"name"`
		Username       string `json:"username"`
		AuthorID       string `json:"author_id"`
		Text           string `json:"text"`
		ConversationID string `json:"conversation_id"`
	}
	Meta struct {
		ResultCount *int   `json:"result_count"`
		NextToken   string `json:"next_token"`
	}
	Includes struct {
		Users []struct {
			ID       string `json:"id"`
			Name     string `json:"name"`
			Username string `json:"username"`
		} `json:"users"`
	} `json:"includes"`
}

type TwitterListTweetsResponse

type TwitterListTweetsResponse struct {
	Data []struct {
		ID        string `json:"id"`
		Text      string `json:"text"`
		CreatedAt string `json:"created_at"`
	} `json:"data"`
	Meta struct {
		NewestID    string `json:"newest_id"`
		OldestID    string `json:"oldest_id"`
		ResultCount int    `json:"result_count"`
		NextToken   string `json:"next_token"`
	} `json:"meta"`
}

type TwitterMessageResponse

type TwitterMessageResponse struct {
	Data struct {
		DMConversationID string `json:"dm_conversation_id"`
		DMEventID        string `json:"dm_event_id"`
	} `json:"data"`
}

type TwitterResponse

type TwitterResponse struct {
	Data struct {
		ID            string `json:"id"`
		Name          string `json:"name"`
		Username      string `json:"username"`
		PublicMetrics struct {
			FollowersCount int64 `json:"followers_count"`
			FollowingCount int64 `json:"following_count"`
			TweetCount     int64 `json:"tweet_count"`
		} `json:"public_metrics"`
	} `json:"data"`
}

type TwitterRetweetResponse

type TwitterRetweetResponse struct {
	Data struct {
		Retweeted bool `json:"retweeted"`
	} `json:"data"`
}

type TwitterTweetError

type TwitterTweetError struct {
	Errors []struct {
		Value     string `json:"value"`
		Title     string `json:"title"`
		Detail    string `json:"detail"`
		Parameter string `json:"parameter"`
		Message   string `json:"message"`
		Type      string `json:"type"`
	} `json:"errors"`
	Title     string `json:"title"`
	Detail    string `json:"detail"`
	Message   string `json:"message"`
	Parameter string `json:"parameter"`
	Type      string `json:"type"`
}

type TwitterTweetResponse

type TwitterTweetResponse struct {
	Data struct {
		ID       string `json:"id"`
		Text     string `json:"text"`
		AuthorID string `json:"author_id"`
	} `json:"data"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL