types

package
v1.0.12 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AXON_TABLE              string = "axon"
	AXON_USER_SESSION_TABLE string = "axon_user_session"
)
View Source
const (
	DEVELOPMENT string = "development"
	PRODUCTION  string = "production"
)
View Source
const (
	PrivateRoute = "private"
	PublicRoute  = "public"
)
View Source
const (
	AUTH_SESSION string = "axon_auth_session"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AxonContext

type AxonContext struct {
	Context   context.Context
	Settings  Settings          `json:"settings"`
	Oauth     oauthTypes.Config `json:"oauth"`
	SessionId string
}

type AxonContextKey

type AxonContextKey string

type AxonData

type AxonData struct {
	Email   string   `json:"email"`
	Folders []Folder `json:"folders"`
}

type Edge

type Edge struct {
	UserId     string    `json:"user_id"`
	FolderID   string    `json:"folder_id"`
	NoteID     string    `json:"note_id"`
	EdgeID     string    `json:"edge_id"`
	SourceID   string    `json:"source"`
	TargetID   string    `json:"target"`
	Animated   bool      `json:"animated"`
	Label      string    `json:"label"`
	EdgeType   string    `json:"edge_type"`
	LastEdited time.Time `json:"last_edited"`
}

type Folder

type Folder struct {
	UserId      string    `json:"user_id"`
	FolderID    string    `json:"folder_id"`
	FolderName  string    `json:"folder_name" `
	DateCreated time.Time `json:"date_created"`
	LastEdited  time.Time `json:"last_edited"`
}

type FolderList

type FolderList struct {
	UserId      string    `json:"user_id"`
	FolderID    string    `json:"folder_id"`
	FolderName  string    `json:"folder_name"`
	DateCreated time.Time `json:"date_created"`
	LastEdited  time.Time `json:"last_edited"`
	Notes       []Note    `json:"notes"`
}

type HttpSettings

type HttpSettings struct {
	AllowedOrigins   []string `yaml:"allowed_origins"`
	AllowedMethods   []string `yaml:"allowed_methods"`
	AllowedHeaders   []string `yaml:"allowed_headers"`
	ExposedHeaders   []string `yaml:"exposed_headers"`
	AllowCredentials bool     `yaml:"allow_credentials"`
	MaxAge           int      `yaml:"max_age"`
}

type Metadata

type Metadata struct {
	Environment string `yaml:"environment"`
	Version     string `yaml:"version"`
}

type Node

type Node struct {
	UserId     string      `json:"user_id"`
	FolderID   string      `json:"folder_id"`
	NoteID     string      `json:"note_id"`
	NodeID     string      `json:"node_id"`
	Data       NodeData    `json:"data"`
	Position   Position    `json:"position"`
	Content    NodeContent `json:"node_content"`
	Styles     NodeStyles  `json:"node_styles"`
	LastEdited time.Time   `json:"last_edited"`
}

type NodeContent

type NodeContent struct {
	MarkDown string `json:"markdown" bson:"markdown"`
}

type NodeData

type NodeData struct {
	Label        string `json:"label"`
	Title        string `json:"title"`
	Description  string `json:"description"`
	NodeCategory string `json:"node_category"`
}

type NodeStyles

type NodeStyles struct {
	BackgroundStyles  map[string]interface{} `json:"background_styles"`
	LabelStyles       map[string]interface{} `json:"label_styles"`
	DescriptionStyles map[string]interface{} `json:"description_styles"`
}

type Note

type Note struct {
	UserId      string    `json:"user_id"`
	FolderID    string    `json:"folder_id"`
	NoteID      string    `json:"note_id"`
	NoteName    string    `json:"note_name"`
	Description string    `json:"description"`
	DateCreated time.Time `json:"date_created"`
	LastEdited  time.Time `json:"last_edited"`
}

type NoteDetail

type NoteDetail struct {
	UserId      string    `json:"user_id"`
	FolderID    string    `json:"folder_id"`
	NoteID      string    `json:"note_id"`
	NoteName    string    `json:"note_name"`
	Description string    `json:"description"`
	DateCreated time.Time `json:"date_created"`
	LastEdited  time.Time `json:"last_edited"`
	Nodes       []Node    `json:"nodes"`
	Edges       []Edge    `json:"edges"`
}

type OauthSettings

type OauthSettings struct {
	Provider       string   `yaml:"provider"`
	ClientID       string   `yaml:"client_id"`
	ClientSecret   string   `yaml:"client_secret"`
	AccessTokenUrl string   `yaml:"access_token_url"`
	AuthorizeUrl   string   `yaml:"authorize_url"`
	RedirectUri    string   `yaml:"redirect_uri"`
	APIBaseUrl     string   `yaml:"api_base_url"`
	Scope          []string `yaml:"scope"`
	State          string   `yaml:"state"`
}

type Position

type Position struct {
	X int `json:"x" bson:"x"`
	Y int `json:"y" bson:"y"`
}

type Route

type Route struct {
	Path    string                                                 `json:"path"`
	Auth    string                                                 `json:"auth"`
	Handler func(http.ResponseWriter, *http.Request, *AxonContext) `json:"handler"`
	Method  string                                                 `json:"method"`
}

type Session added in v1.0.5

type Session struct {
	SessionId   string
	SessionData UserCache
}

type Settings

type Settings struct {
	Metadata      Metadata      `yaml:"metadata"`
	HttpSettings  HttpSettings  `yaml:"http"`
	OauthSettings OauthSettings `yaml:"oauth_settings"`
	CoreSettings  struct {
		GithubArchiveRepo string `yaml:"github_archive_repo"`
	} `yaml:"core_settings"`
	AxonClient struct {
		AuthRedirectUrl string `yaml:"auth_redirect_url"`
		ErrorUrl        string `yaml:"error_url"`
	} `yaml:"axon_client"`
}

type User

type User struct {
	UserId    string `json:"user_id"`
	Email     string `json:"email"`
	UserName  string `json:"username"`
	FirstName string `json:"first_name"`
	LastName  string `json:"last_name"`
	Avatar    string `json:"avatar"`
}

type UserCache

type UserCache struct {
	User        User   `json:"user"`
	AccessToken string `json:"access_token"`
}

Jump to

Keyboard shortcuts

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