config

package
v0.0.0-...-671fe2d Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

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 GetFileExtension(filePath string) string

func IsFileTypeAllowed

func IsFileTypeAllowed(ext string) bool

func IsFileTypeAllowedByValue

func IsFileTypeAllowedByValue(value string) bool

Types

type AppSettings

type AppSettings struct {
	AccessToken  string
	RefreshToken string
	Expires      time.Time
}

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 GetFileTypeByExtension(extension string) FileType

func GetFileTypeByFilePath

func GetFileTypeByFilePath(filePath string) FileType

func GetFileTypeByName

func GetFileTypeByName(name string) FileType

func GetFileTypeByValue

func GetFileTypeByValue(value string) FileType

Jump to

Keyboard shortcuts

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