Documentation
¶
Index ¶
- Variables
- func GetAllowedTypes() []string
- func GetFileExtension(filePath string) string
- func IsFileTypeAllowed(ext string) bool
- func IsFileTypeAllowedByValue(value string) bool
- type AppSettings
- func (s *AppSettings) GetAccessToken() string
- func (s *AppSettings) GetRefreshToken() string
- func (s *AppSettings) GetTokenExpiry() time.Time
- func (s *AppSettings) Save()
- func (s *AppSettings) SetAccessToken(token string)
- func (s *AppSettings) SetRefreshToken(token string)
- func (s *AppSettings) SetTokenExpiry(expiry time.Time)
- type FileType
Constants ¶
This section is empty.
Variables ¶
View Source
var AcceptedTypes = []FileType{ { Name: "Plain Text", Value: "plaintext", Extensions: []string{"txt"}, }, { Name: "JavaScript", Value: "javascript", Extensions: []string{"js", "jsx", "mjs", "cjs"}, }, { Name: "TypeScript", Value: "typescript", Extensions: []string{"ts", "mts", "cts", "tsx"}, }, { Name: "Python", Value: "python", Extensions: []string{"py"}, }, { Name: "JSON", Value: "json", Extensions: []string{"json"}, }, { Name: "HTML", Value: "html", Extensions: []string{"html"}, }, { Name: "CSS", Value: "css", Extensions: []string{"css"}, }, { Name: "Markdown", Value: "markdown", Extensions: []string{"md"}, }, { Name: "Lua", Value: "lua", Extensions: []string{"lua"}, }, { Name: "Go", Value: "go", Extensions: []string{"go"}, }, { Name: "Rust", Value: "rust", Extensions: []string{"rs"}, }, { Name: "XML", Value: "xml", Extensions: []string{"xml"}, }, { Name: "YAML", Value: "yaml", Extensions: []string{"yaml", "yml"}, }, { Name: "MDX", Value: "mdx", Extensions: []string{"mdx"}, }, { Name: "SCSS", Value: "scss", Extensions: []string{"scss"}, }, { Name: "Less", Value: "less", Extensions: []string{"less"}, }, { Name: "Elixir", Value: "elixir", Extensions: []string{"ex", "exs"}, }, { Name: "C++", Value: "cpp", Extensions: []string{"cpp"}, }, { Name: "C#", Value: "csharp", Extensions: []string{"cs"}, }, { Name: "Java", Value: "java", Extensions: []string{"java"}, }, { Name: "Kotlin", Value: "kotlin", Extensions: []string{"kt"}, }, { Name: "Dart", Value: "dart", Extensions: []string{"dart"}, }, { Name: "Scala", Value: "scala", Extensions: []string{"scala"}, }, { Name: "Handlebars", Value: "handlebars", Extensions: []string{"hbs", "handlebars"}, }, { Name: "Pug", Value: "pug", Extensions: []string{"pug"}, }, { Name: "Ruby", Value: "ruby", Extensions: []string{"rb"}, }, { Name: "PHP", Value: "php", Extensions: []string{"php"}, }, { Name: "Swift", Value: "swift", Extensions: []string{"swift"}, }, { Name: "Solidity", Value: "solidity", Extensions: []string{"sol"}, }, { Name: "SQL", Value: "sql", Extensions: []string{"sql"}, }, { Name: "Dockerfile", Value: "dockerfile", Extensions: []string{"dockerfile"}, }, { Name: "Shell", Value: "shell", Extensions: []string{"sh"}, }, { Name: "PowerShell", Value: "powershell", Extensions: []string{"ps1"}, }, { Name: "R", Value: "r", Extensions: []string{"r"}, }, { Name: "Perl", Value: "perl", Extensions: []string{"pl"}, }, { Name: "GraphQL", Value: "graphql", Extensions: []string{"graphql", "gql"}, }, { Name: "Clojure", Value: "clojure", Extensions: []string{"clj"}, }, { Name: "Objective-C", Value: "objective-c", Extensions: []string{"m"}, }, }
Functions ¶
func GetAllowedTypes ¶
func GetAllowedTypes() []string
func GetFileExtension ¶
func IsFileTypeAllowed ¶
Types ¶
type AppSettings ¶
func New ¶
func New() AppSettings
func (*AppSettings) GetAccessToken ¶
func (s *AppSettings) GetAccessToken() string
func (*AppSettings) GetRefreshToken ¶
func (s *AppSettings) GetRefreshToken() string
func (*AppSettings) GetTokenExpiry ¶
func (s *AppSettings) GetTokenExpiry() time.Time
func (*AppSettings) Save ¶
func (s *AppSettings) Save()
func (*AppSettings) SetAccessToken ¶
func (s *AppSettings) SetAccessToken(token string)
func (*AppSettings) SetRefreshToken ¶
func (s *AppSettings) SetRefreshToken(token string)
func (*AppSettings) SetTokenExpiry ¶
func (s *AppSettings) SetTokenExpiry(expiry time.Time)
type FileType ¶
type FileType struct { Name string `json:"name"` Value string `json:"value"` Extensions []string `json:"extensions"` }
func GetFileTypeByExtension ¶
func GetFileTypeByFilePath ¶
func GetFileTypeByName ¶
func GetFileTypeByValue ¶
Click to show internal directories.
Click to hide internal directories.